Click here to Skip to main content
15,885,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
:rolleyes:
Is there any way to customize the appearance of the focus rectangle of the current cell in a datagridview?

I am working with datagridview where the datagridviewselectionmode is fullrowselect


Thanks in advance
Posted
Updated 5-Apr-21 0:40am

1 solution

private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
e.Paint(e.CellBounds, DataGridViewPaintParts.All & ~DataGridViewPaintParts.Focus);
e.Handled = true;
}
 
Share this answer
 
Comments
CHill60 6-Apr-21 9:38am    
An unexplained, uncommented, unformatted code dump is not a solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900