I need to get notified after a row has been deleted from a DataGrid.
What I'm going to do then, is to update a different object, which in turn will modify the datagrid contents.
A method hooked up to RowEditEnding handles when new rows are added, or existing rows are modified, but isn't called when rows are deleted.
I first tried looking for something similar to RowEditEnding, but there wasn't any.
I then tried searching this forum, and found this thread http://wpf.codeplex.com/Thread/View.aspx?ThreadId=51987
I added a preview executed handler as outlined in the thread, and everything was called, but nothing happened... and then it struck me that it was called before anything was changed.
I then switched from using a preview executed handler to an executed handler. But that handler was never called.
The ItemsSource of the datagrid is an ObservableCollection, so I tried listening for a Remove action there. But that failed with a stacktrace that was caused by
System.InvalidOperationException: Cannot change ObservableCollection during a CollectionChanged event.
So... is there a way for me to get notification after a row has been deleted, that I haven't seen? Was adding an executed handler supposed to be the right way of listening for a completed delete command?