TreeView: add more than one node to nodes collection

P

Peter

Hello,
Can somebody help me with this problem. I need to add
more than one node to tree in one loop. Becasue if I want
to create a tree with 4000 and more nodes, it is slow. I
think if I'd allocate memory for all nodes which I want (I
know nodes count before creating a tree) it was be faster.

thanks
 
S

Stephen Bullen

Hi Peter,
Can somebody help me with this problem. I need to add
more than one node to tree in one loop. Becasue if I want
to create a tree with 4000 and more nodes, it is slow. I
think if I'd allocate memory for all nodes which I want (I
know nodes count before creating a tree) it was be faster.

The usual technique for handling tree views with lots of nodes is to
populate the child nodes when the user clicks on the parent node to
expand it. Other than that, you might find it helps to set the
TreeView control invisible before you add all the nodes, then set it
visible again afterwards.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk
 
P

Peter Hanzel

Hi Stephen,
Thanks for interesting of my problem. I try to make a tree invisible,
before adding nodes, but it was not reason of my problem. I didn't write
in my problem description,that sometimes are 4000 nodes in one level
(and already I populate the child nodes when user clicks on the parent
node). If you know solution of my problem now, please, mail me back.
Thank you

Regards
Peter

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

Stephen Bullen

Hi Peter,
Thanks for interesting of my problem. I try to make a tree invisible,
before adding nodes, but it was not reason of my problem. I didn't write
in my problem description,that sometimes are 4000 nodes in one level
(and already I populate the child nodes when user clicks on the parent
node). If you know solution of my problem now, please, mail me back.

If you have 4000 nodes at one level, I would suggest that a TreeView is
not an appropriate display mechanism - having to scroll through 4000 items
to find the one you want would be a nightmare for the users, wouldn't it?

One other thing that might be worth trying if you're willing to get
down-and-dirty at the API level is Brad Martinez's TVFastLoad example at
http://www.mvps.org/btmtz/treeview/

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk
 

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