My code is like this
BindingSource bs=new BindingSource();
List<Items> lstItems= ListItems();
bs.DataSource=lstItems;
I bind this bindingsouce to a gridview.
grd.DaataSource=bs;
Then I copy this original BindingSource to a separate BindngSource
BindingSource filterBs=new BindingSource();
Then I use the filter condition for Bindingsource
filterBs.Filter= "ItemCode='1' and cost>'200'";
grd.DataSource=null;
Rebind the grid snap to the filtered snap object.
grd.DataSource=filterBs;
But now it also shows all the entries in the grid.
source
share