Event on List

Stonkie

Well-known member
Joined
Sep 12, 2007
Messages
279
Programming Experience
1-3
I'm looking to use a List object for storing integers, but unlike the datatable, it doesn't raise any event such as ItemAdd, ItemRemoved, ItemChanged which I need to be notified of.

The list is to contain the ids of the rows that must be hidden from the user in an inherited DataView. I would simply listen on the SomethingChanged event and refresh the filter string to match (no fine grained control over this unless it is necessary for performance).

I could inherit the a List object with my own implementation or hide the List's reference in my object and implement my own add/remove methods in the inherited DataView.

The first one forces me to override/shadow every overload of every method for adding, removing, setting any value and make sure none of these call the other or the event would be fired twice. Quite a mess.

And the second leads me to implementing add, add many, remove, remove many, set, replace, etc. methods in my inherited DataView which leads to a lot of unnecessary methods and complexity.

I was wondering if there were any premade (either built-in or freely available on the web) collection (generic as possible) that would throw these events for me and allow me to just add that single event handler...
 
Thanks! There are so many tools in that framework, the hard part is to find them...
 
Back
Top