Select Row/RowHeader programmatically

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

I have a Grid whose Rows should be selected via RowHeader. So i’ve set

grid.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
and

grid.RowHeaderMouseClick += GridOnRowHeaderMouseClick;

now i can’t get programmatically Row/Rowheader selection working.

 

grid.ClearSelection();
grid.CurrentCell = null;

foreach (var row in grid.Rows)
{
if (someCondition)
{
row.Selected = true; // Doesn't mark the RowHeader as selected
row.HeaderCell.Selected = true; // Not supported
break;
}
}

Additionally selecting via a bound Object would be a nice Enhancement.

 

Best Regards

Corvin

 

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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.

Best Regards

Corvin

  • You must to post comments
Showing 2 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json