treeview - getting from node & to node

3 posts, 0 answers
  1. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 24 Aug 2010 Link to this post

    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. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 27 Aug 2010 Link to this post

    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;
            }
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 27 Aug 2010 Link to this post

    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;
            }
Back to Top