TreeView control is slow

A

ANU

I have a tree view which i load completely at the time of my webpage load.
When i click on the + signs of the parent nodes, it expands to show all of
its children. Similarly, when i click on the node itself, it expands to show
its children. It works fine but it is very slow as compared to clicking on +
sign to load children. No other event or process runs in the background when
i click on the node or the + sign of the folder image. In my treeview each
parent can have atleast 200 to 300 children and sub-children. I have my
treeview in an update panel.

These are the properties that i set for each node when i load the treeview
initially.

childNode.Text = childRow("Name")
childNode.Value = childRow("CategoryId")
childNode.SelectAction = TreeNodeSelectAction.SelectExpand

Please let me know how to improve my performance. I would appreciate any
help.

Thank you.
Anu
 
B

bruce barker

first don't use an update panel for a tree. trees take too long for the
browser to render and an update panel makes the browser re-render the
whole tree for every change.

you should use a ajax based tree. when the user opens a node, fetch the
data from the server and add to the tree.

-- bruce (sqlwork.com)
 
A

ANU

Hi Bruce,

Thanks for a reply. I had actually trided loading child nodes for the
selected node by making a call to the server on each click if it does not
have any child nodes already loaded with the asp.net tree view. It works fine
but it makes a call to the database every time i need to child nodes. I
wanted to reduce the traffic to the databse...

Also if i remove the updatepanel, each node click reloads the whole page.
How do i avoid that? I would really appreciate it if you could let me know if
there are any free AJAX treeview controls available?

Thanks,
Anu
 

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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top