diff --git a/SunnyUI.Demo.sln b/SunnyUI.Demo.sln index df4086ba..2faa5748 100644 --- a/SunnyUI.Demo.sln +++ b/SunnyUI.Demo.sln @@ -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 diff --git a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe index 4a89066a..776234ca 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe and b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe differ diff --git a/SunnyUI.Demo/Controls/FCombobox.cs b/SunnyUI.Demo/Controls/FCombobox.cs index aa614d4b..34b20cef 100644 --- a/SunnyUI.Demo/Controls/FCombobox.cs +++ b/SunnyUI.Demo/Controls/FCombobox.cs @@ -113,21 +113,11 @@ namespace Sunny.UI.Demo private void uiComboDataGridView1_ValueChanged(object sender, object value) { - if (value == null) + uiComboDataGridView1.Text = ""; + if (value != null && value is DataGridViewRow) { - uiComboDataGridView1.Text = ""; - } - else - { - if (value is DataGridViewRow) - { - DataGridViewRow row = (DataGridViewRow)value; - uiComboDataGridView1.Text = row.Cells["Column1"].Value.ToString(); - } - else - { - uiComboDataGridView1.Text = ""; - } + DataGridViewRow row = (DataGridViewRow)value; + uiComboDataGridView1.Text = row.Cells["Column1"].Value.ToString(); } } @@ -158,21 +148,15 @@ namespace Sunny.UI.Demo private void uiComboDataGridView2_ValueChanged(object sender, object value) { - if (value == null) + uiComboDataGridView2.Text = ""; + if (value != null && value is DataGridViewSelectedRowCollection) { - uiComboDataGridView2.Text = ""; - } - else - { - uiComboDataGridView2.Text = ""; - if (value is DataGridViewSelectedRowCollection collection) + DataGridViewSelectedRowCollection collection = (DataGridViewSelectedRowCollection)value; + foreach (var item in collection) { - foreach (var item in collection) - { - DataGridViewRow row = (DataGridViewRow)item; - uiComboDataGridView2.Text += row.Cells["Column1"].Value.ToString(); - uiComboDataGridView2.Text += "; "; - } + DataGridViewRow row = (DataGridViewRow)item; + uiComboDataGridView2.Text += row.Cells["Column1"].Value.ToString(); + uiComboDataGridView2.Text += "; "; } } } diff --git a/SunnyUI.Demo/SunnyUI.Demo.csproj b/SunnyUI.Demo/SunnyUI.Demo.csproj index 3bc99785..992a0267 100644 --- a/SunnyUI.Demo/SunnyUI.Demo.csproj +++ b/SunnyUI.Demo/SunnyUI.Demo.csproj @@ -1,5 +1,5 @@  - + Debug