I have a Grid whose Rows should be selected via RowHeader. So i’ve set
grid.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
grid.RowHeaderMouseClick += GridOnRowHeaderMouseClick;
now i can’t get programmatically Row/Rowheader selection working.
grid.CurrentCell = null;
foreach (var row in grid.Rows)
row.Selected = true; // Doesn't mark the RowHeader as selected
row.HeaderCell.Selected = true; // Not supported
Additionally selecting via a bound Object would be a nice Enhancement.
As of now and most likely for the first release the DGV control only supports full row selection. Column and cell selection will be added after the release.
Seems like when I do
grid.CurrentCell = null before selecting, the Row ( and RowHeader) is at all not selected in the UI.
when I comment
grid.CurrentCell = null the RowHeader of the last selected Row is still marked after selecting and the newly selected Row is selected but the RowHeader not.
At both tries in Debug i can see that the selected-Property is changing.