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
2732
Notify changes in datasource
posted

Hi,

When using the ultrawingrid (version 11.2.20112.1010) and a bindinglist as a datasource I am searching for a way to trap the event when an item was deleted (or added) from (to) the bindingsource.
Or to be more general: an event like the ListChanged event (on a BindingList) notifying me of any changes in the datasource of the grid.

I noticed there is a BeforeRowsDeleted and AfterRowsDeleted event but these only fire when using the "del" key (allowdelete=true and selecttyperow <> none) on a selected row.
In my case the add or remove happens on the bindinglist that is used as a datasource for the grid and thus the events mentioned above do not fire.
The only way to trap these events, according to my current knowledge, is to use the ListChanged event on a BindingList.

Why would I be needing these events?
1. When an item is removed from the list I want to select the next item in the list.
2. When the last item is removed from the list I want the AfterRowActivate or SelectChange event to fire with "nothing" as a value. In order for me to know that "nothing" is active/selected and I can
clear some other fields in my application (that contain additional data of the current selected and/or active item). Currently these events are not fired...

Both of the above scenarios can occur when the grid is filtered.
I would prefer to use events of the grid instead of events of the BindingList to fulfill my needs.

Any help would be greatly appreciated.

Thank you.