This is a migrated thread and some comments may be shown as answers.

How to add TreeList into template of Grid?

1 Answer 155 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
VnDevil
Top achievements
Rank 2
VnDevil asked on 20 Nov 2015, 03:21 AM

Hi Telerik,

 

I was trying add TreeList in Grid with ClientDetailTemplate but It's not running, I afraid Grid is not support ClientDetailTemplate with TreeList,
Can you please give me a demo about this issue?
Thanks alot

1 Answer, 1 is accepted

Sort by
0
Accepted
Venelin
Telerik team
answered on 23 Nov 2015, 03:34 PM
Hello VnDevil,

Yes, currently this scenario is not supported, but you can initialize the treelist on client instead. Try the following:

The grid:
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.EmployeeViewModel>()
    .Name("grid")
    ...
    .ClientDetailTemplateId("template")
    .Events(events => events.DetailExpand("detailsExpand"))
)

Template:
<script id="template2" type="text/kendo-tmpl">
    <div id="treelist_#=EmployeeID#" class="treelist"></div>
</script>

DetailsExpanded handler:
function detailsExpand(item) {
    ...
    item.detailRow.find(".treelist").kendoTreeList({
       ...
    });
}

Then, through the item parameter you can access your data.

Regards,
Venelin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TreeList
Asked by
VnDevil
Top achievements
Rank 2
Answers by
Venelin
Telerik team
Share this question
or