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.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to display multiple tree/expander columns in TreeGrid

In the TreeGrid control, there is built-in support to display only one tree column. And the position of the tree column can be changed using the treeColumnIndex property. By default, the value of this property is set to 0.

But, it is possible to display two/more tree columns with the tree column behavior by using column template support.

The below code example explains about displaying custom tree column in TreeGrid using column template.

<div id="TreeGridContainer" style="height:350px;width:100%;"></div>
<script type="text/x-jsrender" id="customColumnTemplate">
   <div style='height:20px;' unselectable='on'>
      {{if hasChildRecords}}<div class='intend' style='height:1px; float:left; width:{{:level*20}}px; display:inline-block;'></div>
      {{else !hasChildRecords}}
   <div class='intend' style='height:1px; float:left; width:{{:(level)*20}}px; display:inline-block;'></div>
   <div class='{{if expanded}}e-treegridexpand e-icon {{else hasChildRecords}}e-treegridcollapse e-icon {{/if}} {{if level===4}}e-doc{{/if}}' style='height:20px;width:30px;margin:auto;float:left;margin-left:10px;
       style=' float left;display:inline-block; unselectable='on'></div>
   <div class='e-cell' style='display:inline-block;width:100%' unselectable='on'>{{:#data['priority']}}</div>
<script type="text/javascript">
treeColumnIndex: 1,
columns: [
  {field: "taskID", headerText: "Task Id", width: 55},
  {field: "taskName", headerText: "Task Name"},
  {field: "startDate", headerText: "Start Date", editType: "datepicker", format: "{0:M/dd/yyyy}"},
  {field: "endDate", headerText: "End Date", editType: "datepicker", format: "{0:M/dd/yyyy}"},
  {field: "priority", headerText: "Priority", isTemplateColumn: true, templateID: "customColumnTemplate"},
  {field: "progress", headerText: "Progress", editType: "numericedit"},


Display two tree columns in tree grid.

A sample to display two tree columns in TreeGrid is available in the following link,



You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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