I'm having some troubles to achieve the multiselect behavior I want in an hierarchical grid
The behavior I want:
- When a parent row is selected, all the child rows get selected automatically
- When at least 1 child row is selected, the parent row gets selected automatically
- When I 'ctrl-click' on a selected child row, the row gets deselected
- When a parent row gets deselected, all the child rows get deselected automatically
I tried implementing this behavior using the "SelectionChanged" and "CurrentRowChanged" events, but did not succeed.
Even without programmatically setting the "IsSelected" status of rows, it seems that the grid has problems remembering the "IsSelected" status of child rows. For example, when I select 3 of 5 child rows of a certain parent row and then select another parent row, 1 of the 3 selected rows get deselected. I should expect all the child rows to get deselected or all the child rows to stay selected.
Can you show me how I can achieve the wanted behavior?