更新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 # Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SunnyUI.Demo", "SunnyUI.Demo\SunnyUI.Demo.csproj", "{6AE19B87-C2AA-4C56-BC26-1C343F30FF58}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SunnyUI.Demo", "SunnyUI.Demo\SunnyUI.Demo.csproj", "{6AE19B87-C2AA-4C56-BC26-1C343F30FF58}"
EndProject EndProject

Binary file not shown.

View File

@ -113,21 +113,11 @@ namespace Sunny.UI.Demo
private void uiComboDataGridView1_ValueChanged(object sender, object value) private void uiComboDataGridView1_ValueChanged(object sender, object value)
{ {
if (value == null) uiComboDataGridView1.Text = "";
if (value != null && value is DataGridViewRow)
{ {
uiComboDataGridView1.Text = ""; DataGridViewRow row = (DataGridViewRow)value;
} uiComboDataGridView1.Text = row.Cells["Column1"].Value.ToString();
else
{
if (value is DataGridViewRow)
{
DataGridViewRow row = (DataGridViewRow)value;
uiComboDataGridView1.Text = row.Cells["Column1"].Value.ToString();
}
else
{
uiComboDataGridView1.Text = "";
}
} }
} }
@ -158,21 +148,15 @@ namespace Sunny.UI.Demo
private void uiComboDataGridView2_ValueChanged(object sender, object value) private void uiComboDataGridView2_ValueChanged(object sender, object value)
{ {
if (value == null) uiComboDataGridView2.Text = "";
if (value != null && value is DataGridViewSelectedRowCollection)
{ {
uiComboDataGridView2.Text = ""; DataGridViewSelectedRowCollection collection = (DataGridViewSelectedRowCollection)value;
} foreach (var item in collection)
else
{
uiComboDataGridView2.Text = "";
if (value is DataGridViewSelectedRowCollection collection)
{ {
foreach (var item in collection) DataGridViewRow row = (DataGridViewRow)item;
{ uiComboDataGridView2.Text += row.Cells["Column1"].Value.ToString();
DataGridViewRow row = (DataGridViewRow)item; uiComboDataGridView2.Text += "; ";
uiComboDataGridView2.Text += row.Cells["Column1"].Value.ToString();
uiComboDataGridView2.Text += "; ";
}
} }
} }
} }

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?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')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>