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

treeview - getting from node & to node

2 Answers 84 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 2
Bill asked on 24 Aug 2010, 07:25 PM
I have a treeview. The user fills out data for node #1. However, before saving the data, the user tries to skip to node #3. I am currently displaying a msg to the user if they haven't saved the data for node #1, but if the nodes are more than 1 node apart, all I can do is go to the previous node (node #2). This works fine if the nodes are in succession, but in this case they are two nodes apart. 

Under this circumstance, I would like the app to make the treeview stay at node #1 (the original node).

How can this be accomplished? 

2 Answers, 1 is accepted

Sort by
0
Bill
Top achievements
Rank 2
answered on 27 Aug 2010, 04:36 PM
What I'm trying to accomplish is that I might be on node #1 for instance....

If the user enters data on node  #1, and clicks node #3, but doesn't save it on node #1, I prompt them to save the data. If they don't want to save the data, I would like the node to stay where it is (on node #1 instead of moving to node #3).

I have the following code which I thought for sure would work, but the Nodes only pick up 6 items which are the root level nodes! I have about 150 nodes in the tree including all root, parent & child nodes. According to the docs I read online, the findNodeByValue is supposed to search all the nodes in the tree for the specifiecd value.

How do I get the node to stay where it is???

protected void ProcessSameNode(string value)
        {
            RadTreeNode currentNode = RadTreeView1.Nodes.FindNodeByValue("22");
            currentNode.Selected = true;
        }
0
Bill
Top achievements
Rank 2
answered on 27 Aug 2010, 06:08 PM
I resolved the issue by removing the "Nodes" property from the statement. Below, is the working code.

protected void ProcessSameNode(string value)
        {
            RadTreeNode currentNode = RadTreeView1.FindNodeByValue("22");
            currentNode.Selected = true;
        }
Tags
TreeView
Asked by
Bill
Top achievements
Rank 2
Answers by
Bill
Top achievements
Rank 2
Share this question
or