I had a WPF4 DataGrid Control which contains another DataGrid Control in it’s RowDetailsTemplate. I add a PreviewKeyDown event on both DataGrid control and monitor they’re Keyboard operations.
If press Delete key on keyboard, I’ll delete the SelectedItems in DataGrid Control.
My problem is when I want to delete a row in RowDetailsTemplate DataGrid Control. The event routed, The row in Parent DataGrid which define the RowDetailsTemplate was deleted,too. I know it’s because of the RoutedEvent.RoutingStrategy settings.
But how could I only delete the row in RowDetailsTemplate DataGrid?
Thanks.
I had a WPF4 DataGrid Control which contains another DataGrid Control in it’s RowDetailsTemplate.
Share
Just add an attached behavior to the nested datagrid. So that it should not bubble the deleted event anymore..