All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Hi All,
I have a requirement to show collapse icon (after clicking the expand icon) whether it has a child nodes or not.
Thanks
Hi Harpreet,
A possible approach to achieve the desired result is to use a template as demonstrated in the TreeView Templates Demo.
This way, if an item does not have child nodes you can show the collapse Icon:
@(Html.Kendo().TreeView() .Name("treeview") .TemplateId("treeview-template") ... )
<script id="treeview-template" type="text/kendo-ui-template"> # if (!item.items) { # <span class="k-icon k-i-collapse"></span> # } # #: item.text # </script>
For items that have child nodes, the default behavior of the widget will be used and an expand icon will be rendered. Let me know if this suggestion works for you.
Regards, Aleksandar Progress Telerik