i have a problem with the OnNodeClick event in the tree view. I have the following code in ascx file :
And i am adding the nodes in the code behind:
My code behind:
On Init i am just loading one root node guest, and when Expand is clicked, i am populating
1 to 10 as child nodes. Now, when i click on one of the nodes, i can hit the break point at RadTreeView1_NodeClick and when i run, the tree is getting populated and
everything is fine. Now, my problem is, when i click another node, i CANT hit
the break point(on the second node click) and the tress is also not getting
populated. I can just see "Guest" and not the below nodes. Can any one
please help me. Thanks
<telerik:RadAjaxLoadingPanel ID = "RadAjaxLoadingPanel1" runat ="server"></telerik:RadAjaxLoadingPanel> <telerik:RadAjaxPanel ID = "RadAjaxPanel" runat = "server" > <telerik:RadTreeView ID ="RadTreeView1" runat ="server" Width ="100%" OnNodeExpand = "RadTreeView1_NodeExpand" LoadingStatusPosition ="BeforeNodeText" OnNodeClick = "RadTreeView1_NodeClick" > </telerik:RadTreeView> </telerik:RadAjaxPanel>And i am adding the nodes in the code behind:
My code behind:
Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init LoadRootNodes(RadTreeView1, TreeNodeExpandMode.ServerSideCallBack) End SubPrivate Shared Sub LoadRootNodes(ByVal treeView As RadTreeView, ByVal expandMode As TreeNodeExpandMode) Dim RootNode As New RadTreeNode() RootNode.Text = "Guest" RootNode.Value = "1" RootNode.ExpandMode = expandMode treeView.Nodes.Add(RootNode) End SubProtected Sub RadTreeView1_NodeExpand(ByVal sender As Object, ByVal e As RadTreeNodeEventArgs) PopulateNodeOnDemand(e, TreeNodeExpandMode.ServerSideCallBack) End SubPrivate Shared Sub PopulateNodeOnDemand(ByVal e As RadTreeNodeEventArgs, ByVal expandMode As TreeNodeExpandMode) For i As Integer = 1 To 10 Dim childNode As New RadTreeNode childNode.Text = i.ToString childNode.Value = i.ToString e.Node.Nodes.Add(childNode) Next e.Node.Expanded = True End SubProtected Sub RadTreeView1_NodeClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Dim str As String = e.Node.Value End SubOn Init i am just loading one root node guest, and when Expand is clicked, i am populating
1 to 10 as child nodes. Now, when i click on one of the nodes, i can hit the break point at RadTreeView1_NodeClick and when i run, the tree is getting populated and
everything is fine. Now, my problem is, when i click another node, i CANT hit
the break point(on the second node click) and the tress is also not getting
populated. I can just see "Guest" and not the below nodes. Can any one
please help me. Thanks