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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multi level Stacked Headers

Thread ID:





141926 Jan 10,2019 04:00 PM UTC Jan 11,2019 04:38 AM UTC JavaScript - EJ 2 1
Tags: TreeGrid
Mohamed Salah
Asked On January 10, 2019 04:00 PM UTC

     I want to make multi level Stacked Headers in tree grid like attached image.

M. Salah

Attachment: Capture_cbe6f094.rar

Vignesh Natarajan [Syncfusion]
Replied On January 11, 2019 04:38 AM UTC

Hi Mohammed Salah, 

Thanks for using Syncfusion products. 

Query: “ I want to make multi level Stacked Headers in tree grid like attached image.” 

From your query, we understand that you need to render the TreeGrid with multi level stacked header. We have achieved your requirement by defining the columns inside another column.  

Refer the below code example 

var treeGridObj = new ej.treegrid.TreeGrid({ 
        dataSource: window.stackedData, 
        allowPaging: true, 
        childMapping: 'subtasks', 
        treeColumnIndex: 1, 
        pageSettings: { pageCount: 5 }, 
        columns: [ 
               { headerText:'Orders',textAlign:'Left', 
                { headerText: 'Order Details', textAlign: 'Center',  
                  columns: [ 
                        { field: 'orderID', headerText: 'Order ID', textAlign: 'Right', width: 90 }, 
                        { field: 'orderName', headerText: 'Order Name', textAlign: 'Left', width: 170 },                       
                    headerText: 'Shipment Details', textAlign: 'Center', columns: [ 
                        { field: 'shipMentCategory', headerText: 'Shipment Category', textAlign: 'Left', width: 150 }, 
                        { field: 'shippedDate', headerText: 'Shipped Date', textAlign: 'Right', width: 120, format: 'yMd' }, 
                        { field: 'units', headerText: 'Units', textAlign: 'Left', width: 85 }, 
                { headerText:'Pricing',textAlign:'Left', 
                { headerText: 'Price Details', textAlign: 'Center',  
                columns: [ 
                        { field: 'unitPrice', headerText: 'Price per unit', format: 'c2', type: 'number', width: 110, textAlign: 'Right' }, 
                        { field: 'price', headerText: 'Total Price', width: 110, format: 'c', type: 'number', textAlign: 'Right' } 

Refer the below screenshot for the output 

For your convenience we have prepared a sample which can be referred from below  

Please get back to us if you have further queries. 

Vignesh Natarajan 


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

Live Chat Icon For mobile
Live Chat Icon