tags:

views:

16

answers:

1

I have a Windows form datagridview. I am dynamically changing the background color of 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 get changed 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 rowheader in cell formatting event.

A: 

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