I have a huge DataTable instance bound to a GUI, next to the DataTable there lays a specialized object (let's call it ValuesIndex)implementing fast access to DataTable content. The problem is I need to keep ValuesIndex synchronized with the current state of the DataTable. When there are some values in DataTable which have not been accepted yet - I need to keep them in ValuesIndex. I also need to react properly to RejectChanges - so the whole ValuesIndex returns to its previous state.
Is there a possibility to set up event handlers for DataTable instance so the RejectChanges is catched? I tried to achieve that with usage of RowChanged event, but I cannot rely on that. If I delete a row from a table and then reject the changes, the RowChanged event is not called for some reason.
UPDATE: Turns out that I just deleted the rows the wrong way, instead of calling DataRow.Delete() I used DataTable.Rows.Remove. RowChanging event is fired both on AcceptChanges and RejectChanges