3 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 09 Dec 2013, 10:05 AM
Hi
Swapnil,
Please have a look into the following code snippet to get the value of the selected child node.
ASPX:
C#:
Thanks,
Princy.
Please have a look into the following code snippet to get the value of the selected child node.
ASPX:
<telerik:RadTreeView ID="RadTreeView1" runat="server" OnNodeClick="RadTreeView1_NodeClick"> <Nodes> <telerik:RadTreeNode Text="Node1" runat="server"> <Nodes> <telerik:RadTreeNode Text="Node1.1" runat="server" Value="N1.1"> </telerik:RadTreeNode> <telerik:RadTreeNode Text="Node1.2" runat="server" Value="N1.2"> </telerik:RadTreeNode> </Nodes> </telerik:RadTreeNode> <telerik:RadTreeNode Text="Node2" runat="server"> <Nodes> <telerik:RadTreeNode Text="Node2.1" runat="server" Value="N2.1"> </telerik:RadTreeNode> <telerik:RadTreeNode Text="Node2.2" runat="server" Value="N2.1"> </telerik:RadTreeNode> </Nodes> </telerik:RadTreeNode> </Nodes></telerik:RadTreeView>C#:
protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e){ if (e.Node.Level != 0) { // value of the selected child node string text = e.Node.Value; }}Thanks,
Princy.
0
Gopi
Top achievements
Rank 2
answered on 19 Jan 2015, 12:29 PM
its not working i am getting the text value empty
0
Hello,
If you want to get the text value of the child node you have to modify slightly the code Princy posted:
Regards,
Ivan Danchev
Telerik
If you want to get the text value of the child node you have to modify slightly the code Princy posted:
string text = e.Node.Text;Regards,
Ivan Danchev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
