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

GridDataControl Template

Thread ID:

Created:

Updated:

Platform:

Replies:

90936 Oct 26,2009 08:39 AM UTC Oct 27,2009 09:59 AM UTC WPF 3
loading
Tags: GridControl
Thomas M
Asked On October 26, 2009 08:39 AM UTC

Hi,

I need to style my GridDataControl, but i have some problems,

1) i need to remove the Border between the cell (even in the Header Cell) to make it appears as a list
2) When i apply my HeaderCellTemplate, if i click on the header of the column the sorting make the CellBoundValue (Currently bind to the name of the column) change to Ascending or Descending, How make the Arrow appears without change the original name of the column

Thanks in advance

Thomas M.

Ganesan K [Syncfusion]
Replied On October 26, 2009 02:16 PM UTC

Hi Thomas,

Thanks for using Syncfusion products.

For #1,
You cannot have Custom theme option in our old source. Just now we implemented this feature. It’s avail to you in the RC build going to be released by today. Below is the way of applying themed visual style for the GridDataControl.

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

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\CS

You just commented the border info in the sample for remove the Borders.

public CellBordersInfo HeaderCellBorders
{
get
{
return new CellBordersInfo()
{
//Top = new Pen(new SolidColorBrush(GridUtil.GetXamlConvertedValue("#FF1E2D20")), 0.3d),
//Bottom = new Pen(new SolidColorBrush(GridUtil.GetXamlConvertedValue("#FF242D27")), 0.3d),
//Right = new Pen(new SolidColorBrush(GridUtil.GetXamlConvertedValue("#FF1E2D20")), 0.3d)
};
}
}

public CellBordersInfo ValueCellBorders
{
get
{
return new CellBordersInfo()
{
//Top = new Pen(new SolidColorBrush(GridUtil.GetXamlConvertedValue("#D0DBE5")), 0.3d),
//Bottom = new Pen(new SolidColorBrush(GridUtil.GetXamlConvertedValue("#D0DBE5")), 0.3d)
};
}
}


For #2,

If you want to use the DataTemplate, then you need to override everything (Sort Icon, Filter Icon, etc..). So please use the following process to customize your "Header cell" in an easy way.

We have created the sample that uses the existing styles but it completes overrides the default style loading from our grid assembly.
You can check out the generic.xaml declared in the sample, and change it to anyway you want.

Please download the sample from the below location.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GDC-SortingTriangle-1000894938.zip

Let us know if you need any more details.

Thanks
Ganesan

Thomas M
Replied On October 27, 2009 09:44 AM UTC

Thanks for the complete answer ! i have another small question , how can i override the default selection style ?

Thanks in advance,

Thomas M.

Ganesan K [Syncfusion]
Replied On October 27, 2009 09:59 AM UTC

Hi Thomas,

Thanks for your feedbacks.

You can override the default selection style using the below two properties in the IGridDataVisualStyle.

public Brush HighlightSelectionBackground
{
get
{
return Brushes.Yellow;
}
}

public Brush HighlightSelectionForeground
{
get
{
return Brushes.Black;
}
}

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.

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

;