PLEASE: Treeview Variable into TreeView...

PLEASE: Treeview Variable into TreeView...

Post by Frank Ura » Fri, 17 Oct 2003 21:26:01


Again Hi all

Does somebody has any idea for the following:
I am declaring a variable as MyOwnTreeview and
filling it up. Noew I would like to apply this
TreeView to a TreeView on a Form witch is also
declared as MyOwnTreeview.
How can I do this without unsing the clone Methode??

Best reagrds
Frank
 
 
 

PLEASE: Treeview Variable into TreeView...

Post by Joe Whit » Sun, 19 Oct 2003 16:51:54

Why do you want to fill one treeview and then copy into another? Why not
just fill the treeview that you want to fill?

 
 
 

PLEASE: Treeview Variable into TreeView...

Post by Frank Ura » Sun, 19 Oct 2003 23:18:33

Because I am loading the treeview async, to
keep my application free, because it takes some
time to fill my treeview.
It does not help to delegate the loading prozedure,
I have to fill up a variable and then later just
change the handle of all root nodes.




*** Sent via Developersdex http://www.yqcomputer.com/ ***
Don't just participate in USENET...get rewarded for it!
 
 
 

PLEASE: Treeview Variable into TreeView...

Post by Joe Whit » Mon, 20 Oct 2003 03:49:49

But why are you populating a treeview in your secondary thread, when you
never intend to show that treeview? It's generally a bad idea to use a UI
control to store data in a non-UI thread. It gains you nothing (as you're
finding out) and it can restrict you unnecessarily.

You'd be better off creating your own data structure to hold the tree data,
populating that data structure from your secondary thread, and then doing a
final Control.Invoke() to copy that into the tree. This would have the
added benefit that you could, if desired, delay creation of nested tree
nodes until those nodes were expanded and visible (further improving speed
of that final Invoke() call).