* 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)
|
private void uiComboDataGridView1_ValueChanged(object sender, object value)
|
||||||
{
|
{
|
||||||
if (value is DataGridViewRow)
|
if (value == null)
|
||||||
{
|
{
|
||||||
DataGridViewRow row = (DataGridViewRow)value;
|
uiComboDataGridView1.Text = "";
|
||||||
uiComboDataGridView1.Text = row.Cells["Column1"].Value.ToString();
|
|
||||||
}
|
}
|
||||||
else
|
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 (dataGridView.RowCount > 0 && dataGridView.SelectedIndex >= 0)
|
||||||
{
|
{
|
||||||
if (ShowFilter)
|
if (ShowFilter)
|
||||||
DoValueChanged(this, dataGridView.SelectedRows[0]);
|
DoValueChanged(this, dataGridView.SelectedRows.Count>0 ? dataGridView.SelectedRows[0] : null);
|
||||||
else
|
else
|
||||||
DoValueChanged(this, dataGridView.SelectedIndex);
|
DoValueChanged(this, dataGridView.SelectedIndex);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user