We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Platform: WinForms |
Control: GridControl
Tags: themes

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 forums, Direct-Trac, or feedback portal. We are always happy to assist you!

 

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile