|
Rank: Member Groups: Member
Joined: 10/1/2010 Posts: 10
|
I have an existing treeview which I am changing to load on-demand. The colors of the nodes are set dynamically by converting part of the item id to a color. I am currently doing this by setting Node.NormalStyle.ForeColor to the generated color. With the on-demand loading, this works for the top-level items, but not for anything loaded on demand below those.
I have used LookID in other on-demand trees to set the color, but that's not really feasible in this case since I don't know in advance what the colors will be. How can I accomplish this with the on-demand loading?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Style properties such as NormalStyle/HoverStyle are not transferred to the client during load on demand. So that won't work. You can use raw HTML in your node text to do that though. So for example, instead of using "hello" as node text, you can use "<span style='color:blue'>hello</span>" as node text.
Thanks
|
|
Rank: Member Groups: Member
Joined: 10/1/2010 Posts: 10
|
That worked - thanks!
|
|
Rank: Member Groups: Member
Joined: 10/1/2010 Posts: 10
|
While this solution works for displaying the correct color, it is causing other problems because I was using the node text in other places to pass/display the name of the item. I could probably store the name without the HTML in the node value, but I'll have to make a lot of changes. Is there any other way around this?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
No. That's the only way to do it.
Thanks
|
|