3
Answers

Working with FilteredBindingList

Gabriel Goyo

Gabriel Goyo

10y
2.9k
1
Hi guys:

I'm using a FilteredBindingList(which implements the BindingList<T>, IBindingListView interfaces). 
 
Making an instance of FilteredBindingList (FilteredBindingList<SampleObject>), I'm using it as Data Source of a System.Window.Forms.BindingSource object. Using the "Filter" property of BindingSource object, I'm filtering the datasource according to the value of "Filter"

someBindingSource.Filter = string.Format("key={0}",someComboBox.SelectedValue)));

It works fine if I set this "someBindingSource" as datasource of a datagridview. But, if I remove an item from the filtered datasource of the "someBindingSource", the result is wrong, because if I code someBindingSource.RemoveFilter(), the removed item is still on the current DataSource property of "someBindingSource", but the immediatly record which I'm not remove, was removed.

Any of you know why this happens???

Thanks in advance. I' really appreciate.

 



Answers (3)