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
918
Insert at index
posted

I have looked at the samples explorer and the online docs. and still am having no luck inserting a node at a location.  Since the nodes are not uniquely indexed how do you insert at index?  If I select a node three levels down it might have an index of 0 which causes the node to insert at the root level.

Parents
  • 45049
    posted

    Each island of nodes (meaning nodes that share the same parent) are indexed independently.

    If you want to insert a new node three levels down in the tree, you should first get the index of the root node under which your new node would go, then the index of the second-level node under which your new node will go, and then insert your new node to that Nodes collection.

    For instance, to insert "newNode" to the fourth position under the first child of the second parent:

    ultraTree1.Nodes[1].Nodes[0].Insert(3,newNode);

Reply Children