Keeping track of checked nodes in treeview

  • Thread starter Thread starter Cathryn Johns
  • Start date Start date
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?
 
Back
Top