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

Expand TreeNodes Programatically

3 Answers 87 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Sri
Top achievements
Rank 1
Sri asked on 23 Jun 2009, 11:18 PM
I implemented Tree using Load on Demand concept using Web Services. It is working perfectly. But I would like to know the best way to expand the Tree Nodes automatically on click on a context menu. I have a context menu item called "Expand All" and when the User clicks on the item on a Node which has less number of children and sub children, it works fine. If he clicks on the top of the tree, I am getting an error "maximum limit reached".

Below is the code I am using:

private sub ExpandAll(Tnode as RadTreeNode)

If TNode.Nodes.Count = 0 Then _

 

 PopulateHierarchy(TNode)

 

 

RdTViewHierarchy.SelectedNode.ExpandChildNodes()

 

 

TNode.ExpandMode = TreeNodeExpandMode.ClientSide

 

 

TNode.Expanded = True

 

 

For Each TSubNode As RadTreeNode In TNode.Nodes

 

 

 ExpandSelectedNode(TSubNode)

 

 

Next

 

End Sub

 

 

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 24 Jun 2009, 10:59 AM
Hello Sri,

I suggest you check this help topic.

Greetings,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sri
Top achievements
Rank 1
answered on 24 Jun 2009, 01:34 PM
I have the jsonSerialization in the web.config file. But I still have this issue.
When I expand in the code behind, does it relate to jsonSerialization? I guess it is for a webservice and not for a method in the code behind.
0
Atanas Korchev
Telerik team
answered on 24 Jun 2009, 02:04 PM
Hi Sri,

Could you please open a support ticket and send us your page? We need to reproduce the example locally so we know what is causing the exception. Thanks.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
Sri
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Sri
Top achievements
Rank 1
Share this question
or