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

How to change Chevron Icon to custom icon in Tree view?

I need to change Chevron Icon to Plus or Minus icons in tree view, but could not find any option.

5 Replies 1 reply marked as answer

IL Indhumathy Loganathan Syncfusion Team February 19, 2021 07:11 AM UTC

Hi Ameya, 
 
Greetings from Syncfusion support. 
 
We have validated your requirement in TreeView component. You can customize the TreeView expand and collapse icons by using the cssClass property of TreeView. 
 
Please refer to the code snippets. 
 
.custom.e-treeview .e-list-item .e-icon-expandable::before { 
  content: "\e823"; 
} 
 
.custom.e-treeview .e-list-item .e-icon-collapsible::before { 
  content: "\e934"; 
} 
 
.custom .e-list-item .e-icons.e-icon-collapsible { 
  transform: none; 
} 
 
Please find the sample demonstrating the solution. 
 
 
 
Please refer to the below links to know more about EJ2 TreeView component. 
 
 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Indhumathy L


AK ameya kelkar February 22, 2021 11:19 AM UTC

Hi thanks for quick reply, but can we use TreeViewComponent in Gantt? I want to change icons in Gantt Chart.


MS Monisha Sivanthilingam Syncfusion Team February 23, 2021 07:23 AM UTC

Hi Ameya, 
 
We do not need to use the TreeView component in Gantt to change the icons. We have made use of the CSS classes of the expander and collapse icon to change them according to your needs. The following code snippets demonstrate the solution. 
 
Index.css 
.e-treegrid .e-treegridexpand::before { 
  content: "\e934"; 
} 
.e-treegrid .e-treegridcollapse::before { 
  content: "\e823"; 
} 
.e-treegrid .e-treegridexpand { 
  transform: none; 
} 
 
We have prepared a sample for your reference. 
 
Please contact us if you require any further assistance. 
 
Regards, 
Monisha. 


Marked as answer

IA ilyas aktas October 2, 2021 10:26 AM UTC

If the icon of the root element in the treeview is users, if the icon of the child element is user, can you help me?



LA Lokesh Arjunan Syncfusion Team October 4, 2021 10:13 AM UTC

Hi Ilyas aktas 
 
Could you please elaborate on your requirement. We've listed some of the queries. Please clarify if your requirement is one of the following, if not, please share it with more details. 
 
1. Whether need to render TreeView component in one of the columns in Gantt. 
2. Whether need to render different icons for different parent levels for expand/collapse icons. 
 
Regards, 
Lokesh 


Loader.
Up arrow icon