.net – Disable Cell Highlighting in a datagridview

datagridviewnetvb.netwinforms

How to disable Cell Highlighting in a datagridview,
Highlighting should not happen even if I click on the cell.

Any thoughts please

Best Answer

The ForeColor/BackColor kludge wasn't working for me, because I had cells of different colors. So for anyone in the same spot, I found a solution more akin to actually disabling the ability.

Set the SelectionChanged event to call a method that runs ClearSelection

private void datagridview_SelectionChanged(object sender, EventArgs e)
{
    this.datagridview.ClearSelection();
}