【问题标题】:Filter Rows in DataGridView that does not match a String筛选 DataGridView 中与字符串不匹配的行
【发布时间】:2017-12-16 08:20:57
【问题描述】:

我正在使用以下代码根据文本匹配过滤 DataGridView 中的项目,使用以下代码

 //bs is a BindingSource
 bs.Filter = string.Format("Result LIKE '%{0}%'", "match");

我需要过滤那些与字符串不匹配的项目。我该怎么做?

【问题讨论】:

  • 也许我没有理解正确,但是"NOT(Result LIKE '%{0}%')" 不适合你?

标签: c# .net string datagridview filter


【解决方案1】:

据我所知,您可以这样使用NOT LIKE

bs.Filter = string.Format("Result NOT LIKE '%{0}%'", "match");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-09
    • 1970-01-01
    • 1970-01-01
    • 2017-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多