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 apply different styles for StackedHeader in the SfDataGrid?

In SfDataGrid, when you apply style for the StackedHeader, it is applied for all the StackedHeaderColumn, by default. To set the different Style for each StackedHeaderColumn, you need to derive a new class from the GridStackedHeaderCellRenderer and override the OnInitializeEditElement(). You can refer to the following code example to derive a new class from the GridStackedHeaderCellRenderer.

C#

The following code examples illustrate how to define the multiple styles for the GridStackedHeaderCellControl.

XAML

You can apply the above style for GridStackedHeaderCellControl based on the ColumnIndex in the OnInitializeEditElement method. You can refer to the following code example to override OnInitializeEditElement().

C#

You can refer to the following code example to remove the default GridStackedHeaderCellRenderer and add the derived GridStackedHeaderCellRenderer to the renderer’s collection in the SfDataGrid.

C#

The following screenshot shows the applied different style for the StackedHeaderColumn.

D:\KB\Image.png

 

Sample Links

WinRT

WPF

WP WinRT

UWP

Article ID: Published Date: Last Revised Date: Platform: Control: Product Version:
5110 06/02/2015 09/30/2016 WinRT SfDataGrid 12.4.0.24
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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