Keeping track of checked nodes in treeview

C

Cathryn Johns

Hi

I have a treeview where I want to perform some actions on only the
checked nodes. I don't really want to have to traverse the entire tree
every time, since it's a pretty big tree, so what I was trying to do
was keep a list of all the checked nodes - I handle the aftercheck
event so that every time a node is checked I add it to my list, and
when it's unchecked I remove it from my list.

This can become clumsy, though - for example, if I want to
programmatically uncheck some nodes, I can't just iterate through my
list and uncheck them, since that will modify the collection that I'm
enumerating through.

Is there a better approach that I'm missing?
 

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

Top