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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

91063 Nov 2,2009 10:49 PM Nov 4,2009 07:45 AM WPF 1
loading
Tags: GridControl
peifeng.xiang
Asked On November 2, 2009 10:49 PM

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 07:45 AM

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
{
get
{
return Brushes.Aqua;
}
}

public Brush HeaderBackgroundBrush
{
get
{
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.

Thanks
Ganesan

CONFIRMATION

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.

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.

;