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. Image for the cookie policy date

How can i create stackedheader and it's columns from code?

Hello, 

We are in trial period, and i was wondering how can i create stackedheader and it's columns at runtime?

Seems i can't find that piece of code anywhere!

Thank in advance!

1 Reply

SH Shakul Hameed M Syncfusion Team January 24, 2014 09:15 AM UTC

Hi omigis,

 

Thanks for contacting Syncfusion Support.

 

We have analyzed your query and we can able to achieve your requirement by using the following code snippet.

 

Code Snippet: [C#]

private void Button_Click(object sender, RoutedEventArgs e)

        {

            GridDataStackedHeaderRow row = new GridDataStackedHeaderRow();

            row.Name = "Row3";

            GridDataStackedHeaderColumn column = new GridDataStackedHeaderColumn();

            column.HeaderText = "Stacked Header";

            column.ColumnSpan = 6;

            row.Columns.Add(column);

            this.SyncGrid.StackedHeaderRows.Add(row);

            this.SyncGrid.Model.View.Refresh();

        }

 

We have prepared the sample based on your requirement and please find the attached sample.

 

Please let us know if this solution helps you.

 

Thanks,

Shakul Hameed



StackedHeaderRunTime_19bdf309.zip

Loader.
Live Chat Icon For mobile
Up arrow icon