I have a WPF DataGrid that has another datagrid declared in a RowDetailsTemplate;
<DataGrid name="dataGrid1" RowDetailsVisibilityMode="VisibleWhenSelected"> ... <DataGrid.RowDetailsTemplate> <DataTemplate> <DataGrid name="dataGrid2"> ... </DataGrid/> </DataTemplate> </DataGrid.RowDetailsTemplate> </DataGrid>
When I CTRL-click a row on a child DataGrid, it does not select the parent datagrid SelectedItem and hides the RowDetailsTemplate .
I assume this is some kind of behavior related to a routed event, but I tried to catch MouseDown / LeftButtonMouseDown in a datagrid, but no event was fired. I also caught the SelectedItemChanged event on the child datagrid and set e.Handled = true; but the event is still fired on the parent.
How can I stop the parent datagrid from unselecting when CTRL -Click on the child DataGridRow?
source share