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

Extended GridStackedHeaderCellRenderer style binding doesnt work in sf 2015 v 2

Thread ID:





119629 Jul 16,2015 06:45 AM UTC Jul 16,2015 12:55 PM UTC WPF 1
Tags: SfDataGrid
Senthil Ramanathan
Asked On July 16, 2015 06:45 AM UTC

I have this block in code for styling stacked headers. It used to work fine but after upgrade to v2 throws compilation errors. The signature of OnInitializeEditElement has changed.

Grid.CellRenderers.Add("StackedHeader"new GridStackedHeaderCellRendererExt(Grid));
public class GridStackedHeaderCellRendererExt : GridStackedHeaderCellRenderer
        private SfDataGrid totalPaidGrid;
        public GridStackedHeaderCellRendererExt(SfDataGrid totalPaidGrid)
            // TODO: Complete member initialization
            this.totalPaidGrid = totalPaidGrid;
        // override the OnInitializeEditElement
        public void OnInitializeEditElement(
                                            Syncfusion.UI.Xaml.ScrollAxis.RowColumnIndex rowColumnIndex,
                                            GridStackedHeaderCellControl uiElement, GridColumn column, object dataContext)
            var colum = (dataContext as StackedColumn);
            if (colum.ChildColumns.Contains("Total"))
                var style = totalPaidGrid.Resources["customCellStyleStackedHeaderTotal"as Style;
                uiElement.Style = style;
                var style = totalPaidGrid.Resources["customCellStyleStackedHeader"as Style;
                uiElement.Style = style;

            base.OnInitializeEditElement(rowColumnIndex, uiElement, column, dataContext);

        }     }

Jayaleshwari N [Syncfusion]
Replied On July 16, 2015 12:55 PM UTC

Hi Senthil,

We are sorry about the inconvenience caused.

We have changed the override methods’ s parameters for all renderers. We have mentioned the changes details in Release Notes also. Please refer the following link to know the changes that we have made in our latest release.

Release Notes: http://files2.syncfusion.com/Installs/v13.2.0.29/ReleaseNotes/WPF.html

You have to modify the method signature as below. From dataColumn parameter, you can access RowColumnIndex and GridColumn.

public class GridStackedHeaderCellRendererExt : GridStackedHeaderCellRenderer


    private SfDataGrid totalPaidGrid;

    public GridStackedHeaderCellRendererExt(SfDataGrid totalPaidGrid)


        // TODO: Complete member initialization

        this.totalPaidGrid = totalPaidGrid;


    // override the OnInitializeEditElement

    public override void OnInitializeEditElement(DataColumnBase dataColumn, GridStackedHeaderCellControl uiElement, object dataContext)


        var colum = (dataContext as StackedColumn);

        if (colum.ChildColumns.Contains("Total"))


            var style = totalPaidGrid.Resources["customCellStyleStackedHeaderTotal"] as Style;

            uiElement.Style = style;




            var style = totalPaidGrid.Resources["customCellStyleStackedHeader"] as Style;

            uiElement.Style = style;


        base.OnInitializeEditElement(dataColumn, uiElement, dataContext);


Please let us know, If you have any other queries.


Jayaleshwari N.


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