Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
How to find a NodeID
posted

Can someone help me?

I need to be able to loop through a WebTree that has Parent and Child branches.  I need to look at the Child Branches for a Item I have placed in a tag.  If the item is found "True" then I need to select (on the Server Side) that child node.

How do I do this?

 

 

Parents
No Data
Reply
  • 995
    posted

    You can use following recursion code to select a node anywhere in the tree based on search string value:

                    foreach (Node n in this.UltraWebTree1.Nodes)

            {

                FindNodeByTag("TagValue", n);

            }

    private void FindNodeByTag(string NodeTag, Node node)

           {

     

                  foreach (Node n in node.Nodes)

                  {

     

                         if (n.Tag.ToString() == NodeTag)

                                n.Selected = true;

     

                         if (n.Nodes.Count > 0)

                               FindNodeByTag(NodeTag, n);

     

                  }

     

           }

     

Children
No Data