I have a treeview with a root node initially as Root. If i right click on Root node i will have a context menu displayed with some options as New and other if i select New i will add a child node to the Root node. If i again Right click on the Root node and if the Root has child nodes i would like to clear all child nodes and add a new child node how can i do this
TreeNode.Nodes gives you a list of all child nodes to the node you're looking at.
You can then call Clear on that collection to delete all childnodes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With