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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set the backgound color of column headers and selected rows

Thread ID:





91063 Nov 3,2009 03:49 AM UTC Nov 4,2009 12:45 PM UTC WPF 1
Tags: GridControl
Asked On November 3, 2009 03:49 AM UTC

I'm using the GridDataControl. I can not find the way to set the background color mentioned above from the help document.

Ganesan K [Syncfusion]
Replied On November 4, 2009 12:45 PM UTC

Hi Hyla,

Thanks for using Syncfusion products.

We have an interface that lets you define the themed visual style for the GridDataControl. This would be exposed as a CustomVisualStyle property
You can create the custom theme by simply creating a class which implements the IGridDataVisualStyle

You can use the below properties for set HighlightSelectionBackground,HeaderBackground in IGridDataVisualStyle.

public Brush HighlightSelectionBackground
return Brushes.Aqua;

public Brush HeaderBackgroundBrush
return Brushes.Gray;

Then set the Created custom class to the GridDataControl using the property CustomVisualStyle as assigned in the below snippet.
this.dataGrid.CustomVisualStyle = new GridDataGlassyGreenStyle();

Finally set the VisualStyle as Custom,
this.dataGrid.VisualStyle = VisualStyle.Custom;

We have a sample for this feature in our Dashboard in the below location.

\WPF\Grid.WPF\Samples\3.5\WindowsSamples\Grid Data Control - Advanced\Custom Visual Style Demo

Please let us know if you need any more details.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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