node.ParentNode.Nodes.Remove(node) is removing Parent node when the top child node is removed.

2 posts, 0 answers
  1. Richard
    Richard avatar
    5 posts
    Member since:
    Jun 2017

    Posted 21 Jun 2017 Link to this post

    I'm trying to remove a child node. This is working fine as long as it is not the top child node under the Parent

    Parent

         child1

         child2

         child3

         child4

    If I remove child2, 3 or 4; it works. But if I remove child1, the Parent is removed along with any remaining child nodes.

    The behavior I expected is that I should be able to remove any of the child nodes in any order and the Parent node should be removed only when the last remaining child node is removed - but even that is debatable since what if I wanted to add more child nodes to the Parent node after removing everything?

     

    Here is my code:

    Dim remove_node As RadTreeNode = rtvClientSpecs.FindNode(Function(x) x.Value = e.CommandArgument.ToString())           remove_node.ParentNode.Nodes.Remove(remove_node)

     

  2. Richard
    Richard avatar
    5 posts
    Member since:
    Jun 2017

    Posted 21 Jun 2017 in reply to Richard Link to this post

    I figured this one out as well, thanks.
Back to Top