* UIComboDataGridView: 修复一处点击清除按钮后确定出错
This commit is contained in:
parent
9212a13d74
commit
3fc7f9aee5
Binary file not shown.
Binary file not shown.
@ -108,14 +108,21 @@ namespace Sunny.UI.Demo
|
||||
|
||||
private void uiComboDataGridView1_ValueChanged(object sender, object value)
|
||||
{
|
||||
if (value is DataGridViewRow)
|
||||
if (value == null)
|
||||
{
|
||||
DataGridViewRow row = (DataGridViewRow)value;
|
||||
uiComboDataGridView1.Text = row.Cells["Column1"].Value.ToString();
|
||||
uiComboDataGridView1.Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
uiComboDataGridView1.Text = "";
|
||||
if (value is DataGridViewRow)
|
||||
{
|
||||
DataGridViewRow row = (DataGridViewRow)value;
|
||||
uiComboDataGridView1.Text = row.Cells["Column1"].Value.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
uiComboDataGridView1.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ namespace Sunny.UI
|
||||
if (dataGridView.RowCount > 0 && dataGridView.SelectedIndex >= 0)
|
||||
{
|
||||
if (ShowFilter)
|
||||
DoValueChanged(this, dataGridView.SelectedRows[0]);
|
||||
DoValueChanged(this, dataGridView.SelectedRows.Count>0 ? dataGridView.SelectedRows[0] : null);
|
||||
else
|
||||
DoValueChanged(this, dataGridView.SelectedIndex);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user