0

Please see the following code on a Winform Load method:

List<CustomersDTO> res = new List<CustomersDTO>();
res = _CustomerBO.GetCustomers();
customerBindingSource.DataSource = res;
customerDataGridView.DataSource = this.customerBindingSource;
customerBindingNavigator.BindingSource = this.customerBindingSource;

Now I want to filter on Searchbutton but I am not able to see filtered record on screen.

customerBindingSource.Filter = "Active = false";

I am missing something.. I did reasearch. Can anybody give me exact code example? I read about implementing IBindingList but not sure how to do that with my BindingSource..

Can anyone help?

4

1 回答 1

2

您不必实施IBindingList. 您可以构造 aBindingList作为customerBindingSource. 像这样:

customerBindingSource.DataSource = new BindingList<CustomersDTO>(res);
于 2013-07-11T15:14:02.763 回答