i have a datagridview and i would like the rowheader to correctly select that entire row.
Although i thought it should anyway, it does not. i have tried the following but with no luck, can you see something obvious? =P
regards, Dave
private void dataGridView2_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
dataGridView2.Rows[e.RowIndex].Selected = true;
}
Try setting the
and
You can read about the MultiSelect Property and SelectionMode Property in the MSDN library linked.
If you want the user to select multiple rows, then set
MultiSelectto true.EDIT
And then you can call your event like this:
To select individual cells within the data grid view and select the entire row on row header click, set the selection mode to RowHeaderSelect
The MSDN explanation for
RowHeaderSelectis: Clicking a cell selects it. Clicking a row header selects the entire row.