I have a custom section in Umbraco with a tree built with some custom logic.
Everything works great. My only issue is that now I have a requirment to set the text color of the node according to some business logic. Is there a way to do this? I could not find something in node object itself. It does have a style property, but it's readonly, as far as I can tell.
Hi. I suppose you can make use of the BaseTree.BeforeNodeRender event and set the XmlTreeNode.Style property depending on the node in your event handler.
Style different tree nodes
Hi,
I have a custom section in Umbraco with a tree built with some custom logic.
Everything works great. My only issue is that now I have a requirment to set the text color of the node according to some business logic. Is there a way to do this? I could not find something in node object itself. It does have a style property, but it's readonly, as far as I can tell.
Thank you!
Hi. I suppose you can make use of the BaseTree.BeforeNodeRender event and set the XmlTreeNode.Style property depending on the node in your event handler.
Have a look at the source of the Multi Node Tree Picker. There the color of the nodes is also changed sometimes. There it's done with javascript.
Jeroen
is working on a reply...