RadTreeView for ASP.NET

NodeClick Send comments on this topic.
Telerik RadTreeView Server-Side > Server-Side Events > NodeClick

Glossary Item Box

NodeClick

The control fires the NodeClick event when the end-users click on a tree node that is marked with the PostBack ="True" attribute. Alternatively you can mark the whole RadTreeView with the AutoPostBack attribute to force postback for all tree nodes. See this example:  

ASPX Copy Code
<rad:RadTreeView
 
ID="RadTree1"
 
runat="server"
 
AutoPostBack="True"
 
OnNodeClick="NodeServerEvent"
 
Height="250px">
</
rad:RadTreeView>

 

Then in the code-behind you should handle the fired event. The code below gets the text of the clicked node and assigns it to a Label.

VB.NET Copy Code
Protected info As Label
...
Protected Sub NodeServerEvent(sender As Object, NodeEventArgs As RadTreeNodeEventArgs)
Dim NodeClicked As RadTreeNode = NodeEventArgs.NodeClicked
info.Text = NodeClicked.FullPath
End Sub 'NodeServerEvent
C# Copy Code
protected Label info;
...
protected void NodeServerEvent(object sender, RadTreeNodeEventArgs NodeEventArgs)
{
info.Text =
string.Empty;
RadTreeNode NodeClicked = NodeEventArgs.NodeClicked;
info.Text = NodeClicked.Text;
}
...