Search code examples
wpfdatagridcollectionviewsource

Intercepting DataGrid's Adding Event


I'm trying to intercept the WPF datagrid's event for adding a new item. I need to set some properties on the data object which is inserted into the datasource. Is there a way I can do this?


Solution

  • I solved this by binding to an ObservableCollection<T>, then using the CollectionChanged event.