We help IT Professionals succeed at work.

Change font of Node

Medium Priority
374 Views
Last Modified: 2012-05-06
Hi experts,
i need change font only 1 node dinamic generated on my TreeView component in ASP.NET using VB.NET.

Please help me.
Comment
Watch Question

Principal Software Engineer
CERTIFIED EXPERT
Commented:
hi,

The styling is available for specific nodes/template

like you may do that like

TreeView1.HoverNodeStyle.BackColor =Drawing.Color.Red


other can be for each level
default node style
for selected node
for parent node
leafnode style
parennode
child node ..

and as per you criteria you may use any of them

Thanks

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Praveen VenuTechnical Project Manager

Commented:
if your text is Test

then change it to <font color="red">Test</font>
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Its very easy for windows applications as shown below.
        Dim n As New TreeNode
        n.NodeFont = Me.Font

There is no direct way of doing this in ASP.NET.
You can change the selectednodestyle and make the node selected programmatically to apply that style on it. To select a node:
treeview1.nodes(1).selected=True
or
treeview1.nodes(1).select()
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.