* UIComboDataGridView: 增加过滤字异常判断
This commit is contained in:
parent
4aa6fd8911
commit
d15b52d414
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@ -365,10 +366,18 @@ namespace Sunny.UI
|
|||||||
filter = string.Join(" or ", strings);
|
filter = string.Join(" or ", strings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filter = filter.Replace("*", "[*]");
|
filter = filter.Replace("*", "[*]");
|
||||||
if (dataGridView.DataSource is DataTable table)
|
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));
|
ComboDataGridViewFilterChanged?.Invoke(this, new UIComboDataGridViewArgs(edtFilter.Text, dataGridView.RowCount));
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
* 2022-04-16: V3.1.3 增加行多选
|
* 2022-04-16: V3.1.3 增加行多选
|
||||||
* 2022-06-16: V3.2.0 增加下拉框宽度、高度
|
* 2022-06-16: V3.2.0 增加下拉框宽度、高度
|
||||||
* 2022-06-19: V3.2.0 增加FilterChanged,输出过滤文字和记录条数
|
* 2022-06-19: V3.2.0 增加FilterChanged,输出过滤文字和记录条数
|
||||||
|
* 2022-09-08: V3.2.3 增加过滤字异常判断
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user