Skip to content

Select Row/RowHeader programmatically #307

Description

@itg-assistant

Corvin asked 2016-10-06 16:43:11 UTC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions