ArrayList filter?

  • Thread starter Thread starter Tomer
  • Start date Start date
T

Tomer

Hi,

How can I perform filtering on an array list which is bind to a datagrid.
For example:

I have a boolean field in the objects inside the array which states if the
row should be visible to the user or not.
I need to display only the objects that have a 'true' value in that field.

Any help would be great!

Tomer.
 
You need to create your own collection class that implements IBindingList,
make sure you return true in SupportsChangeNotification, has Filter property
and raise ListChanged event when the filter is changed. ListChanged event
should be raised with ListChangedType set to Reset. All of the IList and
ICollection properties and methods should be delegated to the inner
ArrayList member.
 
Back
Top