adding Telerik MVC DropDownList in TreeView Template

343 views Asked by At

I want to add a Telerik MVC DropDownList in TreeView Template, but it is not working in this way: can anyone tell me whats the problem?

<script id="treeTemplate" type="text/kendo-tmpl">
<p>#: item.text #</p>
<p>#=item.id#</p>
<p>
    @(Html.Kendo()
            .DropDownList()
            .Name("Permission_#:item.id#")
            .BindTo(Permissionable.GetPermissionTitles())
            .DataTextField("Title")
            .DataValueField("Permission")
            .ToClientTemplate()
    )
</p>

@(Html.Kendo().TreeView()
.Name("PAbles")
.TemplateId("treeTemplate")
.HtmlAttributes(new { @class = "tree tree-selectable" })
.BindTo(Model.Permissionables, 
    mapping => mapping
    .For<Permissionable>(binding => binding
        .Children(c => c.Childs)
        .ItemDataBound((item, c) =>
            {
                item.Text = c.Title ?? c.Name;
                item.Id = c.ID.ToString();
            }
        )
    )
))
0

There are 0 answers