!57 UIComboDataGridView使用过滤功能时,字符串中包含 * ,需要加上'[]'进行转义

Merge pull request !57 from Schr0dingerCat/master
This commit is contained in:
Sunny 2022-09-08 05:12:33 +00:00 committed by Gitee
commit 4aa6fd8911
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Windows.Forms; using System.Windows.Forms;
@ -365,7 +365,7 @@ namespace Sunny.UI
filter = string.Join(" or ", strings); filter = string.Join(" or ", strings);
} }
} }
filter = filter.Replace("*", "[*]");
if (dataGridView.DataSource is DataTable table) if (dataGridView.DataSource is DataTable table)
{ {
table.DefaultView.RowFilter = filter; table.DefaultView.RowFilter = filter;