How do I change the selected row programatically?
I change change the selected item and cell, but I cannot figure out how to get the whole row highlighted.
Note: The highlighting works fine when a user selects a row with mouse or keyboard.
How do I change the selected row programatically?
I change change the selected item and cell, but I cannot figure out how to get the whole row highlighted.
Note: The highlighting works fine when a user selects a row with mouse or keyboard.
take a look at this page. You need both the SelectionUnit
and SelectionMode
to specify how the selection is done in the DataGrid.
With SelectionUnit = FullRow
and SelectionMode = Single
, the user can only select one row at a time.
edit: after trying it out, it looks as though DataGrid.SelectedItem[i]
will select an entire row. Unfortunately, it looks as if you will have to manually set the highlight in an event handler that you have to create for the SelectionChanged
property of the DataGrid.