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

Leaf Node Image of a Treeview (with remote data binding)

1 Answer 377 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Tareq
Top achievements
Rank 1
Tareq asked on 04 Jul 2013, 03:35 PM
I have a treeview with databound to remote data from database. What I need is to set the image (icon) for the leaf nodes. The leaf nodes are of two different types; based on their type I need to set the icon before the text of the leaf node. I can easily set the image for parent nodes by setting the css for ".k-treeview .k-plus" and ".k-treeview .k-minus", but I do not know how to do it for leaf nodes based on their type.  I do not see any example of how to do that in the treeview demo either. It has one section that shows how to set the leaf node image, but the tree nodes are hard coded in the view with their image url hardcoded. I need something that has remote data binding and the treeview created dynamically. Any information on that will be highly appreciated. Thanks.

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 08 Jul 2013, 01:52 PM
Hello Tareq,

In order to conditionally display images for the TreeView's nodes you could use a template with custom logic. For working example take a look at this online demo

Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Tareq
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or