更新Demo

This commit is contained in:
Sunny 2022-04-18 17:09:22 +08:00
parent 866af62b33
commit c495c5c425
4 changed files with 13 additions and 29 deletions

View File

@ -1,5 +1,5 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SunnyUI.Demo", "SunnyUI.Demo\SunnyUI.Demo.csproj", "{6AE19B87-C2AA-4C56-BC26-1C343F30FF58}"
EndProject

Binary file not shown.

View File

@ -112,23 +112,13 @@ namespace Sunny.UI.Demo
}
private void uiComboDataGridView1_ValueChanged(object sender, object value)
{
if (value == null)
{
uiComboDataGridView1.Text = "";
}
else
{
if (value is DataGridViewRow)
if (value != null && value is DataGridViewRow)
{
DataGridViewRow row = (DataGridViewRow)value;
uiComboDataGridView1.Text = row.Cells["Column1"].Value.ToString();
}
else
{
uiComboDataGridView1.Text = "";
}
}
}
private void uiComboDataGridView1_SelectIndexChange_1(object sender, int index)
@ -157,16 +147,11 @@ namespace Sunny.UI.Demo
}
private void uiComboDataGridView2_ValueChanged(object sender, object value)
{
if (value == null)
{
uiComboDataGridView2.Text = "";
}
else
{
uiComboDataGridView2.Text = "";
if (value is DataGridViewSelectedRowCollection collection)
if (value != null && value is DataGridViewSelectedRowCollection)
{
DataGridViewSelectedRowCollection collection = (DataGridViewSelectedRowCollection)value;
foreach (var item in collection)
{
DataGridViewRow row = (DataGridViewRow)item;
@ -176,5 +161,4 @@ namespace Sunny.UI.Demo
}
}
}
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>