* UIComboDataGridView: 增加过滤字异常判断

This commit is contained in:
Sunny 2022-09-08 13:55:47 +08:00
parent 4aa6fd8911
commit d15b52d414
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
@ -365,10 +366,18 @@ namespace Sunny.UI
filter = string.Join(" or ", strings);
}
}
filter = filter.Replace("*", "[*]");
if (dataGridView.DataSource is DataTable table)
{
table.DefaultView.RowFilter = filter;
try
{
table.DefaultView.RowFilter = filter;
}
catch (Exception ex)
{
UIMessageTip.ShowError(ex.Message);
}
}
ComboDataGridViewFilterChanged?.Invoke(this, new UIComboDataGridViewArgs(edtFilter.Text, dataGridView.RowCount));

View File

@ -22,6 +22,7 @@
* 2022-04-16: V3.1.3
* 2022-06-16: V3.2.0
* 2022-06-19: V3.2.0 FilterChanged
* 2022-09-08: V3.2.3
******************************************************************************/
using System;