Home - Forums-.NET - FlyTreeView (ASP.NET) - Per node font styling

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Per node font styling
Link Posted: 23-Aug-2007 09:28
As I am still testing this control, one of the features our client asked about was the font styling per node.

Is it possible to assign (for example) a CssClass to a node? That way it would be possible to make certain nodes bold/different font (color) etc.

It's a pretty short question, but it would be great if it could be answered.

PS. I know I can put HTML tags in the text property, but it would be wonderfull if we could assign CssClasses directly to the node.
Link Posted: 23-Aug-2007 10:33
In short, there's no per-node CssClass assignment.

Typically, every treeview just has limited number of node types. Each type can have different style/behavior settings (including CssClass).

This is what FlyTreeView.NodeTypes collection was designed for.
You can always define required number of nodetypes (programmatically or using design tools) that use required CSS classes and implement required behavior.

And then bind to nodes using node.NodeTypeID property. Or just make nodetype to be automatically assigned to nodes by some condition (see autoapplyatlevels and autoapplyatleafs attributes).


Other option (as you mentioned) is to use something like
text
for node text.
But I don't think anyone really needs it.
Link Posted: 23-Aug-2007 10:47
[quote="EvgenyT"]In short, there's no per-node CssClass assignment.

Typically, every treeview just has limited number of node types. Each type can have different style/behavior settings (including CssClass).

This is what FlyTreeView.NodeTypes collection was designed for.
You can always define required number of nodetypes (programmatically or using design tools) that use required CSS classes and implement required behavior.

And then bind to nodes using node.NodeTypeID property. Or just make nodetype to be automatically assigned to nodes by some condition (see autoapplyatlevels and autoapplyatleafs attributes).


Other option (as you mentioned) is to use something like
text
for node text.
But I don't think anyone really needs it.


Ah ok! That explains it! Sorry, maybe I should have read the documentation. Sorry for my obvious question then. I will look into it.