Change color to selected node treeview

How can I apply css to a webtreeview, since I am seeing that by default it adds a style that is not defined anywhere and what it intends to do is change the background color of a selected node.

Thank you very much for your help.

Styling a TWebTreeView using CSS is entirely possible but how you approach it depends a little bit on where you want to manage this kind of thing. The HTML/CSS that is generated for the TWebTreeView is pretty extensive. If you have your own style.css file (or equivalent) then you can override whatever is being rendered with something like this, for example.

.TVSELECTED {
    background-color: blue !important;
}

There are quite a few other classes, like TVUL, TVNODE, TVCARET, TVNESTED, TVACTIVE, and so on, so the same approach can be used to adjust other parts of the TWebTreeView.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.