How to change the color of all headers in WinForms GridDataBoundGrid?
BaseStyles control the header colors. To color all headers a particular color, you have to pass the Header in the BaseStyleMap. To color Row Header, you have to pass the Row Header in the BaseStyleMap. To color Column Header, you have to pass the Column Header in the BaseStyleMap
C#
//Change the appearance of headers
this.gridDataBoundGrid1.BaseStylesMap["Header"].StyleInfo.BackColor = Color.Blue;
//Change the appearance of Row Header
this.gridDataBoundGrid1.BaseStylesMap["Row Header"].StyleInfo.BackColor = Color.Red;
//Change the appearance of Column Header
this.gridDataBoundGrid1.BaseStylesMap["Column Header"].StyleInfo.BackColor = Color.White;
VB
'Change the appearance of headers
Me.GridDataBoundGrid1.BaseStylesMap("Header").StyleInfo.BackColor = Color.Blue
'Change the appearance of Row Header
Me.GridDataBoundGrid1.BaseStylesMap("Column Header").StyleInfo.BackColor = Color.White
'Change the appearance of Column Header
Me.GridDataBoundGrid1.BaseStylesMap("Row Header").StyleInfo.BackColor = Color.Red