H
Homer J. Simpson
Hi all,
I just went over a *lot* of tree node style properties (LeftNodeStyle,
NodeStyle, ParentNodeStyle, RootNodeStyle, LevelStyles, HoverNodeStyle,
SelectedNodeStyle, etc etc etc) but can't find exactly what I want.
It seems that I'm in a situation where none of these predefined groups fit
the bill. Ultimately, the style to use needs to be decided as I'm
dynamically adding individual nodes through code. I'd like to do this:
if( [some convoluted conditions] ) {
tnNewNode = new TreeNode( strCaption );
tnNewNode.[Something] = "bold";
tnParent.ChildNodes.Add( tnNewNode );
}
It's this [Something] property that I'm looking for--one that applies to an
individual node, but not necessarily others that happen to fall in some
common category.
I've managed to add separate styles for clickable nodes by using something
like:
..MyTreeClass a
{
(styles that apply to all clickable nodes, which all happen to have an
archor tag)
}
....but I need finer granularity. Thinking along the same way, I've hacked
together the following:
tnNewNode = new TreeNode( "<div class='clsTest'>" + strCaption + "</div>" );
and in my .css file:
..MyTreeClass .clsTest
{
font-weight: bold;
}
But this is *so* ugly I can't help but think there's just gotta be some
better way to do this than force my own div around the node's text.
I just went over a *lot* of tree node style properties (LeftNodeStyle,
NodeStyle, ParentNodeStyle, RootNodeStyle, LevelStyles, HoverNodeStyle,
SelectedNodeStyle, etc etc etc) but can't find exactly what I want.
It seems that I'm in a situation where none of these predefined groups fit
the bill. Ultimately, the style to use needs to be decided as I'm
dynamically adding individual nodes through code. I'd like to do this:
if( [some convoluted conditions] ) {
tnNewNode = new TreeNode( strCaption );
tnNewNode.[Something] = "bold";
tnParent.ChildNodes.Add( tnNewNode );
}
It's this [Something] property that I'm looking for--one that applies to an
individual node, but not necessarily others that happen to fall in some
common category.
I've managed to add separate styles for clickable nodes by using something
like:
..MyTreeClass a
{
(styles that apply to all clickable nodes, which all happen to have an
archor tag)
}
....but I need finer granularity. Thinking along the same way, I've hacked
together the following:
tnNewNode = new TreeNode( "<div class='clsTest'>" + strCaption + "</div>" );
and in my .css file:
..MyTreeClass .clsTest
{
font-weight: bold;
}
But this is *so* ugly I can't help but think there's just gotta be some
better way to do this than force my own div around the node's text.