How to change the color of all headers
9 Dec 2019 / 1 minute to read
The styles of the Header cells are controlled by base styles. The “Header” base style will affect all column headers including cell 0,0. The “Column Header” base style will affect the column headers excluding cell 0,0. The “RowHeader” base style will affect all row headers excluding cell 0,0.
//Column headers including cell 0,0.
this.grid.BaseStylesMap["Header"].StyleInfo.BackColor = Color.Blue;
//Column headers excluding cell 0,0.
this.grid.BaseStylesMap["Column Header"].StyleInfo.BackColor = Color.Red;
//Row headers excluding cell 0,0.
this.grid.BaseStylesMap["Row Header"].StyleInfo.BackColor = Color.Green;
'Column headers including cell 0,0.
Me.grid.BaseStylesMap("Header").StyleInfo.BackColor = Color.Blue
'Column headers excluding cell 0,0.
Me.grid.BaseStylesMap("Column Header").StyleInfo.BackColor = Color.Red
'Row headers excluding cell 0,0.
Me.grid.BaseStylesMap("Row Header").StyleInfo.BackColor = Color.Green
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page