Apply Form.MetroStyles To GridControl
Been trying to figure this out for a day now... lol.
- How do I apply metro color schemes from "Syncfusion.Windows.Forms.MetroColors" to the GridControl object?
- My main form is using MetroForm, and I've set a Metro color to it by Me.MetroColor
- But the Grid shows the default blue metro colors.
how do i change the metro scheme of my controls, and apply them so they
are uniform across.
Thanks...
Hi John,
Thank you for your interest in Syncfusion products.
|
Query Metro Color schemes
to the Grid object. |
Me. MetroColor only change the backcolor of icon used in Grid. To change the color for Grid
you can use the following method. Way 1: This can be achieved by enabling the GridVisualStyles
property. Please refer to the following code snippet and let us know if this
helps. Me. gridGroupingControl1.GridVisualStyles
= GridVisualStyles.Office2007Blue
Way 2 :
The custom visual styles
can be used in which you can specify your own color for the themes on to the
grid. The GridVisualStyles has to be provided as Custom, and the
GridVisualStylesDrawing has to be assigned with the object that has
implemented with the IVisualStylesDrawing.
Way 3 : If you want similar colors
to be applied for grid header cells, then you may do this by adding the
following code to your form's constructor. Please try the code below. Me.gridGroupingControl1.TableDescriptor.Appearance.RowHeaderCell.Interior
= new
BrushInfo(GradientStyle.Vertical, new Color[] { Color.FromArgb(173, 209,
255), Color.White }); Me.gridGroupingControl1.TableDescriptor.Appearance.TopLeftHeaderCell.Interior
= new
BrushInfo(GradientStyle.Vertical, new Color[] { Color.FromArgb(173, 209,
255), Color.White }); Me.gridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Interior
= new BrushInfo(GradientStyle.Vertical, new Color[] { Color.FromArgb(173, 209, 255), Color.White }); |
Please let me know if you have further concerns.
Vinish.
Sorry mate. I tried that but it does not apply the colors. Not sure what I'm doing wrong.
Here's the code I'm using:
Dim test As BrushInfo = New BrushInfo(GradientStyle.Vertical, New Color() {Color.FromArgb(173, 209, 255), Color.Crimson})
Me.GridGroupingControl1.TableDescriptor.Appearance.RowHeaderCell.Interior = test
Me.GridGroupingControl1.TableDescriptor.Appearance.TopLeftHeaderCell.Interior = test
Me.GridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Interior = test
And the result is attached.
Capture_5f3749e2.zip
|
Query Metro Color schemes to the Grid object. |
We regret for the delay caused. You can use the DrawCell event
to achieve the output. Using this event you can change the color for header .
Please see the images we apply the
color for row header. Image 1:
Image 2 :
Image 3:
Please refer the below
codes for your desired output. And also refer the attached output. We hopeful
this sample will helps to you. |
Please let me know if you have further concerns.
Vinish.
105330_730a8f6f.zip
- 3 Replies
- 2 Participants
-
JO John
- Oct 2, 2012 01:31 AM UTC
- Oct 8, 2012 10:51 AM UTC


