Articles in this section
Category / Section

How to customize the color of metro theme in WinForms GridControl?

2 mins read

Customize the metro style

WinForms GridControl have default colors for metro theme. You can customize the metro theme colors through GridMetroColors by using SetMetroStyle method.

The following code example explains the same.

C#

//VisualStyles and themes
GridMetroColors theme = new GridMetroColors();
//changes the header color on mouse hovering.
theme.HeaderColor.HoverColor = Color.CadetBlue;
//sets the header color on normal state.
theme.HeaderColor.NormalColor = Color.PowderBlue;
//sets the BottomBorderColor.
theme.HeaderBottomBorderColor = Color.Red;
//sets the headertextcolor.
theme.HeaderTextColor.NormalTextColor = Color.Navy;
//changes the header text color on mouse hovering.
theme.HeaderTextColor.HoverTextColor = Color.GhostWhite;
//Applys the customized theme to the gridControl metrostyle.
this.gridControl1.SetMetroStyle(theme);

VB

'VisualStyles and themes
Dim theme As New GridMetroColors()
'changes the header color on mouse hovering.
theme.HeaderColor.HoverColor = Color.CadetBlue
'sets the header color on normal state.
theme.HeaderColor.NormalColor = Color.PowderBlue
'sets the BottomBorderColor.
theme.HeaderBottomBorderColor = Color.Red
'sets the headertextcolor.
theme.HeaderTextColor.NormalTextColor = Color.Navy
'changes the header text color on mouse hovering.
theme.HeaderTextColor.HoverTextColor = Color.GhostWhite
'Applys the customized theme to the gridControl metrostyle.
Me.gridControl1.SetMetroStyle(theme)

The following screenshot displays the customized metro style.

Show the customized metro style in GridControl

Figure 1: Customized metro style

Note:

The same procedure is applicable for GridDataBoundGrid.

Conclusion

I hope you enjoyed learning how to customize the color of metro theme in WinForms GridControl or GridDataBoundGrid.

Refer to our WinForms GridControl’s feature tour page for its other groundbreaking feature representations. You can also explore our WinForms GridControl documentation to understand how to present and manipulate data.

For current customers, check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, try our 30-day free trial to check out our WinForms GridControl and other WinForms components.

Please let us know in the following comment section if you have any queries or require clarifications. Contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied