【发布时间】:2012-02-27 22:29:50
【问题描述】:
我已将我的 DataGridView 与一个包含我的一个数据库表中的所有值的 DataSet 链接起来。但我想要做的是过滤我的 DataGridView 以显示我的 DataSet 中的某些值:
例如:
(Where EmployeeID = 4),
有没有办法在不改变我的初始绑定对象的情况下做到这一点?
//Initial datasource
dgv.DataSource = DataSet1.Table[0];
//Some filter code here to display DataSet1 where employeeID = 1
//在不改变初始绑定的情况下在dgv中显示这些结果。
【问题讨论】:
-
我找到了这个问题的答案 Using a BindingSource Object BindingSource bs = new BindingSource();
标签: datagridview dataset