Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
455
IBindingList vs INotifyCollectionChanged
posted

We are using XamDataGrid to display collection of items , we use a custom collection of ours as the backing data source. It currently implements IBindingList (and there by implements ListChanged event. When we bind this collection to our grid it works fine.

We recently ran into few complications recently when items were removed /added to collection during a short snap (ex., 8k items removed from one collection and added to another) , this resulted in performance issues. When we profiled , it indicated to - listChanged being raised per item being added /removed was resulting the in full task of addition/removal one at a time which is not optimal.

* If our collection implements INotifyCollectionChanged (there by raising updates with multiple items rahter than single) - would XamDataGrid use this interface to bind instead of binding it as a BindingList ? (i.e., does not bother with list changed events and lists to collectionChangedEvents , reason we can't remove IBindingList is preserve backward compatibility)

* If above is not possible - is there a way we can indicate to XamDataGrid that we intend to make bulk changes and optimize for that (dont try to recycle every addtion but rather wait for entire batch to complete.)

Would ideally prefer 1 rather than 2 even if it involves us making changes in how we configure our grid.