Remove a Node in Treeview

G

Guest

Hi All,

I have a treeView control, the treeview is generated from DB.
I need to write a function to remove some invalid treenodes in the tree.
for (int i=0; i < treeviewCtrl.count.... )
....
....
if (invalid)
treeviewCtrl.Nodes.RemoveAt(i);


i know the problem is, when the node is removed, the other sublings' index
will be changed.
so how can I avoid this ?

thanks a lot!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top