Category / Section
How to display multiple tree/expander columns in TreeGrid
1 min read
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"></script>
<script type="text/javascript">
$("#TreeGridContainer").ejTreeGrid({
//...
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"},
]
A sample to display two tree columns in TreeGrid is available in the following link,
Didn't find an answer?
Contact Support