I tried with several versions of this clean method, but couldn't succeed to remove all the child nodes of the node that I want to remove.
private void Clean(UltraTreeNode node) { while (node.Nodes.Count > 0) { this.Clean(node.Nodes[0]); } node.Remove(); if (this.NavigationTree.Nodes.Contains(node)) this.NavigationTree.Nodes.Remove(node); }
When I want to add a new node with the same key as a node that I think to be cleaned, I still get key already exists exception.
Hello Burak,
Thank you for contacting Infragistics Developer Support.
I have tried to reproduce your issue using 14.1 (v 14.1.20141.2019) and using the UltraTree.Nodes.Remove(node) method worked fine for me – I could then add the very same node again. What version of Infragistics are you using? I have attached my sample. If this approach doesn’t work for you, please modify it so that it to reproduces your issue and send it back to me.
I am looking forward to your reply.
Thank you for your reply Dimitar. Upon further inspection, I've found out that a node with the same key is added to another part of the tree after deleting, which was causing the problem.