Shimmy Weitzhandler
Shimmy Weitzhandler

Reputation: 104821

Where is DataGrid RowDeleted event?

Hello I am looking for an event I can handle for row deletion.

Upvotes: 2

Views: 1736

Answers (1)

Josh
Josh

Reputation: 69282

Instead of using an event on the DataGrid you should use a collection as its ItemsSource which supports change notification. Unfortunately the de-facto standard "ObservableCollection" does not support an event that fires before an item is removed, but it's quite easy to derive your own collection class from ObservableCollection which overrides RemoveItem and raises an appropriate event that can be cancelled.

Upvotes: 3

Related Questions