We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Node icons in treeview

I would like to show a different icon for each node in the treeview. I have created a CSS style for each of the icons I'm using. I have 13 different icons, and my each of my nodes can have one of those icons as a node icon.
Is there a way to affect an icon to each node icon directly, or must I have to use row templates? 

PS. I'm **NOT** talking about Plus/Minus nodes icons, I'm talking about icons associated with each node.

Regards

2 Replies

KS Kaviyarasu Sivasenapathi Syncfusion Team October 10, 2016 12:29 PM UTC

Hi Ahmed, 
 
 Thanks for contacting Syncfusion support. 
 
Yes, you can give icons for the nodes directly and also by using templates. As per your requirement we have created a sample with different icons for each node. 
 
We have prepared the sample for rendering tree view nodes with span tag. We have live demo sample for your requirement. Please refer the below link: 
 
 
We have prepared the sample for rendering tree view nodes with local data source itself by using “spriteCssClass”. To Know more about “spriteCssClass” please refer the following UG document link: 
 
 
Please let us know if you have any concerns. 
 
Regards, 
Kaviyarasu S  



KS Kaviyarasu Sivasenapathi Syncfusion Team October 10, 2016 01:14 PM UTC

Hi Ahmed, 
 
 Sorry for the inconvenience caused. 
 
In the previous update, we have missed to specify the demo link for rendering tree view nodes with local data source by using “spriteCssClass”. Now you can find the sample at below. 
 
 
Please let us know if you require any further assistance. 
 
Regards, 
Kaviyarasu S  


Loader.
Live Chat Icon For mobile
Up arrow icon