* UIComboDataGridView: 修复一处点击清除按钮后确定出错

This commit is contained in:
Sunny 2022-03-30 21:59:12 +08:00
parent 9212a13d74
commit 3fc7f9aee5
4 changed files with 12 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -107,6 +107,12 @@ namespace Sunny.UI.Demo
}
private void uiComboDataGridView1_ValueChanged(object sender, object value)
{
if (value == null)
{
uiComboDataGridView1.Text = "";
}
else
{
if (value is DataGridViewRow)
{
@ -118,6 +124,7 @@ namespace Sunny.UI.Demo
uiComboDataGridView1.Text = "";
}
}
}
private void uiComboDataGridView1_SelectIndexChange_1(object sender, int index)
{

View File

@ -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);
}