VB.NET

Moderators: seancampbell
Number of threads: 4020
Number of posts: 10026

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Treeview - Speeding up adding of nodes Posted by Markus.L on 6 Jul 2009 at 10:55 PM
Hi,

I'am facing a "serious"/annoying problem at the moment. We are building an web application with Visual Studio 2008/ASP.NET/VB.NET.
We are using version 3.5 of the .NET framework.

In the web app we have an Treeview-control, that we populate with over 5000 nodes, which are added dynamically during the run time. Doing so takes a long time, and is not really acceptable in terms of user friendliness of the UI.

We just recently started to look into speeding it up a bit, and we found out that Begin/EndUpdate-methods should do just that.

There is just one problem, i cannot find these methods under my Treeview at all.

Has it been removed or am i just looking for wrong things from wrong places, i tried looking for it under my Treeview1, but with no luck so far.

______________________________________________________________

If for some reason i canno't use Beginupdate anymore, is there any other way of speeding it up?

Any help or tips would be greatly appreciated.
Thanks in advance.

- Markus

EDIT: Not sure if this would have gone better under the ASP.NET forums. If so, feel free to move it in there.
Report
Re: Treeview - Speeding up adding of nodes Posted by seancampbell on 16 Jul 2009 at 6:16 AM
Sorry for my delay in response, been really deep in development both at work and home and haven't had the time to sit down and provide solutions over the last month...

You are right this should have gone in the ASP.Net forum, but I code VB.Net/ASP.Net web apps all of the time so I think I can help a tad.

The BeginUpdate and EndUpdate are part of the System.Windows.Forms.TreeView but that is only for applications programming. The Control you are using in your ASP.Net page is System.Web.UI.WebControls.TreeView

Anyway, I am under the impression, from the reading I did today, that the only way to speed up the generation of that TreeView is to NOT put all of those nodes in at once, and instead use the PopulateOnDemand=True property to populate the tree as it is being expanded without a post back. This way only a small amount of things are being populated, and you can generate just the essential information. I learned about how to do that today from the sample code on this MSDN article: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.aspx

If that is not an option, and you are just creating a list, I suggest using a ListView, or GridView I think it is in ASP.

Lastly, if you cannot implement a method like this, but need to load in the 5000 objects anyway, maybe there is something you can do in your code to make it more efficient. If this is the case, post your code up here and I will help you try and "lean" it up.

Sorry for the delay,
Sean Campbell - Forum mod
Report
Re: Treeview - Speeding up adding of nodes Posted by Markus.L on 19 Jul 2009 at 10:31 PM
Thank you for your reply.

That explains why i couldn't find it anywhere :)
I will now try the Populateondemand next, for now i did a program strcture that retreives the data as user browses trough the treeview. PopulateonDemand sounds like it might do just that for me, without the "extra" coding.

I also started looking at listview today, it is just that TreeView would have been perfect for my purpose, if it just wasn't for it being so slow.

Anyways, thanks a lot for your help!
Will let you know if i need any further assistance.

- Markus



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.