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.
Syncfusion Feedback

Change visual style in a GridControl in virtual mode

Thread ID:

Created:

Updated:

Platform:

Replies:

90450 Oct 1,2009 03:15 PM UTC Oct 2,2009 10:47 AM UTC WPF 1
loading
Tags: GridControl
Jean-Marc DUHEN
Asked On October 1, 2009 03:15 PM UTC


GridControl :

How to apply a visual style (theme) in virtual mode ?

Do I have to change style for each cell in Model_QueryCellInfo ?

All examples use the "", but there is no such control in my application :)

br


Clay Burch [Syncfusion]
Replied On October 2, 2009 10:47 AM UTC

There is no direct property setting to apply a visualstyle to a GridControl (such settings are only available on GridDataControl and GridTreeControl).

But you can use code such as this to apply such settings to a GridControl.

private void SetVisualStyle(VisualStyle vs, GridControl grid)
{
IGridDataVisualStyle visualStyle = null;
switch (vs.ToString())
{
case "Office2007Blue":
visualStyle = new GridDataBlueVisualStyle();
break;
case "Office2007Black":
visualStyle = new GridDataBlackVisualStyle();
break;
case "Office2007Silver":
visualStyle = new GridDataSilverVisualStyle();
break;
case "Blend":
visualStyle = new GridDataBlendVisualStyle();
break;
case "Office2003":
visualStyle = new GridDataSyncBlueVisualStyle();
break;
default:
visualStyle = new GridDataDefaultGridVisualStyle();
break;
}

grid.Model.HeaderStyle.Background = visualStyle.HeaderBackgroundBrush;
grid.Model.HeaderStyle.Foreground = visualStyle.HeaderForegroundBrush;
grid.InvalidateCells();
}

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.

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

;