This is a migrated thread and some comments may be shown as answers.

Server-side node.highlight()

1 Answer 62 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 31 Jul 2008, 08:32 AM
When I create a node server-side perhaps inside the _NodeExpand() event handler for load-on-demand tree loading,  i'm able to set pretty much most things on the node -- but one thing i've either missed or we just can't do is set the highlight?

In Javascript I can call upon a JS method called node.highlight()  or node.unhighlight()  ....  what are the server side equivalents of these?

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 01 Aug 2008, 11:07 AM
Hi Brian,

When creating the nodes, you can set the Selected property to true on the node you want to be highlighted.

protected void RadTreeView1_NodeExpand(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e) 
    RadTreeNode node = new RadTreeNode("child 1"); 
    e.Node.Nodes.Add(node); 
 
    node = new RadTreeNode("child 2 - selected"); 
    node.Selected = true; 
    e.Node.Nodes.Add(node); 
 
    node = new RadTreeNode("child 3"); 
    e.Node.Nodes.Add(node); 

I hope this helps.

Kind regards,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Brian
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or