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

Sub header or Stacked header

I'm not able to add Stacked header in SfDataGrid . Please help me 

3 Replies

GG Gowtham Gopalsamy Syncfusion Team December 16, 2019 12:15 PM UTC

Hi Ñêw,   
Thank you for using Syncfusion controls.   
We have prepared a sample to achieve your requirement to add the stacked header. We have attached the sample and UG documentation link for your reference. If your requirement is not achieved with the below details, please provide more details about your requirement. It will help us to investigate further and provide earlier prompt solution.   
Please refer the below code snippet.  
//Creating object for a stacked header row.   
 var stackedHeaderRow1 = new StackedHeaderRow();    
//Adding stacked column to stacked columns collection available in stacked header row object.    
stackedHeaderRow1.StackedColumns.Add(new StackedColumn() { ChildColumns ="OrderID,OrderDate"HeaderText = "Order Details" });    
stackedHeaderRow1.StackedColumns.Add(new StackedColumn() { ChildColumns ="CustomerID,ContactNumber,"HeaderText = "Customer Details" });    
stackedHeaderRow1.StackedColumns.Add(new StackedColumn() { ChildColumns ="ProductName,Quantity,UnitPrice,ShipCountry"HeaderText = "Product Details" });   
 //Adding stacked header row object to stacked header row collection available in SfDataGrid.    
Also, please find the below sample and UG link.  
Please let us know, if you require further assistance on this.   

ÑÊ Ñêw January 8, 2020 08:22 AM UTC

Thank you for replying 

Problem solved

FP Farjana Parveen Ayubb Syncfusion Team January 8, 2020 08:35 AM UTC

Hi Ñêw, 
Thanks for the update. 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
Farjana Parveen A 

Live Chat Icon For mobile
Up arrow icon