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

[Solved] Make the node expanded and selected

3 Answers 135 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Asok
Top achievements
Rank 1
Asok asked on 08 Feb 2010, 09:14 PM
I have a treeview with Add/edit/delete context menu items. My problem is I am not able to make the node expanded and selected when I add a child node to aperent node. After adding/editing I am rebinding the treeview using AjaxManager.
Please note that this will have unlimited nodes.

For example,

Node1

- SubNode1

   - SubNode1.1

- SubNode2

- SubNode3

 If I add new node for SubNode1, named SubNode1.1, the focus should be in SubNode1 and it should be expanded to see the new node added.


Any help is greatly appreciated.

Thanx in advance
ASD

3 Answers, 1 is accepted

Sort by
0
Vesko
Top achievements
Rank 2
answered on 09 Feb 2010, 12:32 PM
Have you checked this demo?

It shows how to use the context menu to add / edit / delete nodes and works pretty well.
0
Asok
Top achievements
Rank 1
answered on 10 Feb 2010, 07:06 AM
Thank you for your reply.

I am using the Add/edit/delete with a database operation. When I click the contecxt menu Add/edit, a rad window manager pop up where in the user enter the details. on closing the pop up, i insert the new node value and text in to db. The pop up is an external page. Therfore coming back to the page where the tree resides I rebind the tree using ajax manager. However not able to expnad the node where I added the new node and  also to be selected. I have the last entered node value. I tried using the below code which did not help me.

RadTreeview1.Nodes.FindNodeByValue(nodeID).expanded = true;

Thanks
0
Vesko
Top achievements
Rank 2
answered on 11 Feb 2010, 04:12 PM
Can you debug and see whether RadTreeview1.Nodes.FindNodeByValue(nodeID) returns the correct node?
Because it will search among the root nodes only. You can try this one instead:
RadTreeview1.FindNodeByValue(nodeID)
Tags
TreeView
Asked by
Asok
Top achievements
Rank 1
Answers by
Vesko
Top achievements
Rank 2
Asok
Top achievements
Rank 1
Share this question
or