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!
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. :)
Yes you can, just do not forget to call the ToClientTemplate method at the end. This method should be available for any Kendo widget.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With