Re: Recreate a >>C# WinForms<< TreeView "state" -after- treeview rebuild ?? Any TreeView GODS out there ??



Thanks for the reply. Hadn't considered simply dropping and recreating the
existing nodes. In this case I may actully be able to get away with that!
I'm pretty sure I can get this thing to work using your and the other
replies to my question.

Best wishes. Happy computing and THANKS!

Barry in Oregon

"Pavel Minaev" <int19h@xxxxxxxxx> wrote in message
news:9c5b9387-680b-48db-933a-e795a5bfa6a9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

frostbb wrote:
I have a C# WinForms treeview with 20 or so 'level 0' nodes.

My users will normally have 2 of the 'level 0' branches open down to a
'5th
level' selected node.

The users will make updates to the 2 selected nodes that will alter the
node
name.

I think I need to rebuild the TreeView to get everything synchronized
after
they click an update button.

Not necessarily. If you can track the specific changes that are
happening to the data source from which the tree is loaded, you can
avoid the full rebuild, instead just inserting, removing or moving the
nodes that were changed. And that will preserve the collapsed/expanded
state of all nodes.


.