Unable to change row header background color din XP display style but works in classic display style

506 Views Asked by At

I have a Windows form DataGridView. I am dynamically changing the background color of the row header. The background color is getting successfully changed if the OS display style is classic. However, background color of the row header does not change if the display style is Windows XP.

Please note, I am able to change the background color of the row, though. Can anybody tell me what I am doing wrong?

I am changing the background color of the row header in cell formatting event.

1

There are 1 best solutions below

0
On

You need to set the EnableHeadersVisualStyles property on the DataGridView to false, otherwise it will render the headers using visual styles (i.e. the XP style, or Aero on Vista/7).