【问题标题】:How to filter records in datagrid view and show the selected record in the datagrid如何过滤数据网格视图中的记录并在数据网格中显示选定的记录
【发布时间】:2013-09-05 16:04:25
【问题描述】:

请我有一个带有事务绑定源的datagridview 我希望datagrid 在我在文本框中输入值并单击按钮排序时仅显示排序的行而不是所有记录。谢谢

【问题讨论】:

    标签: vb.net


    【解决方案1】:

    你必须把这样的代码放在你的控件中:

     YourGridViewBindingSource.Filter = String.Format("YourDBColumn Like ;'*" & FilterValue) & "*'"
    

    例如,您可以将代码用作您的TextBox.textchanged 控件,以便在您在 TextBox 中键入时过滤 Datagrid 视图

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-12
      • 1970-01-01
      • 2017-06-13
      • 2018-08-26
      • 2011-10-03
      • 1970-01-01
      • 2011-12-01
      相关资源
      最近更新 更多