How to add a group class to a kendo dropdown tree

1 Answer 8 Views
DropDownTree
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Lee asked on 03 Oct 2025, 10:32 PM
I would like to add a group class to the kendo dropdown tree so that each level can have a different style applied to it. How can I achieve this? Here is a basic Dojo: 
https://dojo.telerik.com/nJvbmwHv

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 08 Oct 2025, 11:23 AM

Hi Lee,

You can add group classes to your DropDownTree using a template with CSS classes:

template: function(dataItem) {
    const level = dataItem.item.hierarchyLevel;
    return `<span class="tree-level-${level}" data-treelevel="${level}">${dataItem.item.text}</span>`;
  }

Dojo demo: https://dojo.telerik.com/RUikVWqB

Please let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Your perspective matters! Join other professionals in the State of Designer-Developer Collaboration 2025: Workflows, Trends and AI survey to share how AI and new workflows are impacting collaboration, and be among the first to see the key findings.
Start the 2025 Survey
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
commented on 08 Oct 2025, 12:50 PM

Unfortunately that is much too far down the tree. I was looking for it to be at the group (ul) level. I ended up just nesting a bunch of css like this:

.k-dropdowntree-group {
  background-color: white;
}

.k-dropdowntree-group .k-dropdowntree-group {
  background-color: gray;
}

.k-dropdowntree-group .k-dropdowntree-group .k-dropdowntree-group {
  background-color: pink;
}
...

Tags
DropDownTree
Asked by
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Answers by
Nikolay
Telerik team
Share this question
or