Check this thread.
Hehe.
Hans Passant
2008-11-16 10:46:28
Put this code either into your form's constructor or set it in datagridview's Properties using the IDE.
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dgv.MultiSelect = false;
dgv.RowPrePaint +=new DataGridViewRowPrePaintEventHandler(dgv_RowPrePaint);
Then paste the following event into the form code:
private void dgv_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
e.PaintParts &= ~DataGridViewPaintParts.Focus;
}
And it works! :-)
"dgv" is the DataGridView in question and "form" is the Form that contains it.
Note, that this soulution doesn't display the dotted rectangle around the whole row. Instead, it removes the focus dots entirely.