)
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. (Last updated on: June 24, 2019).
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 |
Published Date: May 23, 2015 |
Last Revised Date: February 11, 2020
Tags: themes

Customize the metro style

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.

Samples:

C#: CustomizedMetro

VB: CustomizedMetro

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
Live Chat Icon