-
filtering lists
Hello !
I constructed my own filtering system, that gives me the possibility to create complex filters on object lists (like list(of mytype)).
Some time went by and I just wanted to be sure that the framwork does not incorporate such a functionality now.
The idea is that I may filter on various properties of my objects stored in the object list (or even on properties of the objet's properties... etc.), creating and/or associations of the arguments.
Thanks for any feedback :-)
Regards,
Fabian
-
Re: filtering lists
The BindingSource provides this functionality by allowing you to bind a list to it and then set its Filter property. It's usually used with DataTables but it can be bound to any object that can serve as a DataSource for a control. The BindingSource can then be bound to a control, allowing you to indirectly bind any array or collection you like to a control and then sort and/or filter what gets displayed.
-
Re: filtering lists
I see! If I understand it right, then the BindingSource might be used in any circumstances, not only for controls. Meaning that I might retrieve the filtered list of objects to do anything else with them. If this is so... than I lost quite some time for nothing building my filter system ....
Thanks very much for this hot info!
Regards,
Fabian
-
Re: filtering lists
Ah, I just investigated further and only lists that implement the IBindingListView interface can be filtered through a BindingSource. The DataView class does, which is why DataTables can be filtered. It appears that you may not have wasted your time after all.
-
Re: filtering lists
Hey jmcilhinney,
in this concern : did you discover Linq of the framework 3 ?!
Best regards,
Fabian
PS Happy new year.