I have built (loaded data into) a WebDataTree suing JavaScript but I cannot find a way of formatting the Nodes using CSS. I have tried the following:
Overwriting the node properties immediately after a node is created:
function setTreeClasses(tree, CssClassName) {tree._ActiveCssClass = CssClassName;tree._DisabledCssClass = CssClassName;tree._GroupCssClass = CssClassName;tree._HoverCssClass = CssClassName;tree._nodeCssClass = CssClassName;tree._ParentCssClass = CssClassName;tree._RootCssClass = CssClassName;tree._SelectedCssClass = CssClassName;tree._nodeActiveCssClass = CssClassName;tree._nodeDisabledCssClass = CssClassName;tree._nodeGroupCssClass = CssClassName;tree._nodeHoverCssClass = CssClassName;tree._nodeParentCssClass = CssClassName;tree._nodeRootCssClass = CssClassName;tree._nodeSelectedCssClass = CssClassName;tree._controlActiveCssClass = CssClassName;tree.controlStylePrefix = "";}
I have also intercepted the node Added and Adding events and tried to explicitly set CssClass there.
The problem seems to be that there are no (documented) properties or methods for setting the node CssClass, only methods for setting the hover and selected node styles.
Any help gratefully received.
Paul Shearing
VS 2010IG 10.3 WebDataTreeCLR 4.0
Hey, Paul,
You have to make sure the web.config is also adjusted to point at the new style you're applying. You can also include a new style foldier inside the ig_res and specify the web.config at that style. Try doing this and let me know if you're still running into issues.
Thanks Konstantin,
I have tried that and it didn't work - it still shows the application styling (Caribbean).
Perhaps there is something else that i need to set? Also, your suggestion does not allow me to specify the appearance of nodes at different levels in the hierarchy. Essentially i want to be able to specify the format and appearance of individual nodes in the tree using CSS. I could do that with the UltraWebTree.
Kind regards
Paul
Hi again, Paul,
If you would like to use your own custom style with the tree you can set it inside the WebDataTree tag using the CssClass property.
Konstantin Dinev