views:

2628

answers:

4

Can anyone suggest a good implementation of a generic collection class that implements the IBindingListView & IBindingList interfaces and provides Filtering and Searching capabilities?

I see my current options as:

  • Using a class that someone else has written and tested
  • Inheriting from BindingList, and implementing the IBindingListView interfaces
  • Write a custom collection from scratch, implementing IBindingListView and IBindingList.

Obviously, the first option is my preferred choice.

Thanking you.

+1  A: 

A couple of solutions I can think of:

  1. The SubSonic Project has a pretty nice implementation of BindlingList<T> which is open source. Although this might require using the entire SubSonic binary to use their implementation.

  2. I enjoy using the classes from the Power Collections project. It is fairly simple to inherit from one of the base collections there and implement IBindingListView.

Joseph Daigle
+5  A: 

I used and built upon an implementation I found on and old MSDN forum post from a few years ago, but recently I searched around again and found a sourceforge project called BindingListView. It looks pretty nice, I just haven't pulled it in to replace my hacked version yet.

Aaron Wagner
+1  A: 

Here is the help for your method 2 and 3 Behind the Scenes: Implementing Filtering for Windows Forms Data Binding

http://www.microsoft.com/downloads/details.aspx?FamilyID=4af0c96d-61d5-4645-8961-b423318541b4&amp;displaylang=en

TunWN
The code here doesn't actually work! The originalListItems value is never set and so the list doesn't reset correctly. As long as you know this you can add the code in yourself.
Chris
A: 

@chris: what do you mean the originalListItems value is never set? It's set via the OriginalList property! Or do I miss something?

Nico