Is it possible to render a kendo control inside a Kendo Template? Something like this one?
<script id="treeview-template" type="text/kendo-ui-template">
@{Html.Kendo().AutoComplete()
.Name("test")
.Render();
}
</script>
Thanks in advance!
Join Stack Overflow to learn, share knowledge, and build your career.
Is it possible to render a kendo control inside a Kendo Template? Something like this one?
<script id="treeview-template" type="text/kendo-ui-template">
@{Html.Kendo().AutoComplete()
.Name("test")
.Render();
}
</script>
Thanks in advance!
Yes you can, just do not forget to call the ToClientTemplate method at the end. This method should be available for any Kendo widget.
Thanks for the help Pechka! ToClientTemplate() extension method did the job.
<script id="treeview-template" type="text/kendo-ui-template">
# var ctrlid= item.ControlId; #
@(Html.Kendo().AutoComplete()
.Name("#=ctrlid#")
.ToClientTemplate()
)
</script>
But for some reason, when I put "item.ControlId" directly at the name property, it can't render the control. So i tried storing it in a variable and used that on the name property and it worked. :)