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?
Asked
Active
Viewed 259 times
2 Answers
1
There isn't an event you can intercept. But you can probably do what you need with BindingList<T>
. See this How to use a factory for DataGrid.CanUserAddRows = true
0
I solved this by binding to an ObservableCollection<T>
, then using the CollectionChanged
event.

Echilon
- 10,064
- 33
- 131
- 217