1

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.

eglease
  • 2,445
  • 11
  • 18
  • 28
user284534
  • 71
  • 1
  • 1
  • 2

1 Answers1

1

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).

Bradley Smith
  • 13,353
  • 4
  • 44
  • 57