How to delete the selected node in the WinForms TreeViewAdv control?
Delete the selected node
The above code will only delete the selected node if it is a root node. This is because TreeViewAdv.Nodes collection does not contain all the nodes of the tree, just thelevel 0 nodes. If the node is in a level greater than 0, it is not deleted as it is not contained in the primary Nodes collection. So, you instead should call: