0
votes

I have a 3 tier datagrid where when you select an item below the parent, the parent item should be unselected. I use the SelectedItem property in all 3 DataGrids. Is there anyway I can deselect the parent row once the row beneath is selected?

I have my Selecteditem properties in a MVVM structure.

Thanks

1

1 Answers

2
votes

Set the SelectedItem (or the property which is properly bind with the SelectedItem) of the Parent Grid(s) to null, that will work. You achieve this in several ways like, handling the LostFocus of the parent grids, handling the SelectionChanged or GotFocus of the child grids or creating a new dependency property for the DataGrid to achieve this new behaviour.