M
Michel Walsh
Hi,
A datagrid has its DataSource set to a BindingList<CustomClass>. While the
ListChanged event fires AFTER a deletion, I am looking for a simple way to
be notified BEFORE the item would be effectively deleted (for performing
extra check and cleanup). Is there a simple trick I miss, because I don't
know how to do that, except to maintain TWO lists, and compare them in the
ListChanged event (to detect which item is now missing).
Simplified examples of what I try to get :
- check before deleting if there will be at least one 'admin' left
- free C# ressources of the CustomClass item just to be deleted (as a
cascade delete would have done for database records)
Thanks,
Vanderghast, Access MVP
A datagrid has its DataSource set to a BindingList<CustomClass>. While the
ListChanged event fires AFTER a deletion, I am looking for a simple way to
be notified BEFORE the item would be effectively deleted (for performing
extra check and cleanup). Is there a simple trick I miss, because I don't
know how to do that, except to maintain TWO lists, and compare them in the
ListChanged event (to detect which item is now missing).
Simplified examples of what I try to get :
- check before deleting if there will be at least one 'admin' left
- free C# ressources of the CustomClass item just to be deleted (as a
cascade delete would have done for database records)
Thanks,
Vanderghast, Access MVP