Save expand state TreeView

  • Thread starter Thread starter R. Sammut
  • Start date Start date
R

R. Sammut

Hi,

I have a treeview control that is updated every 30 seconds. The
treeview nodes are cleared and new nodes (same number of nodes and
hierarchy) are added to the treeview. Now I need to save the state of
the expanded treeview so that I can apply the same expanded state to
the updated treeview.

is there something i can do?

for e.g. something like

ExpandState es = treeView.GetExpandState();
update_treeView();
treeView.setExpandState(es);

thanks,
RSammut
 
Why dont u generate an xml representation of the nodes and store it in an
xml file. You can then rebuild the tree from the xml. Perhaps creating an
abstraction for import / export would be good.
HTH
Ashish
 
Back
Top