TreeView control is slow

  • Thread starter Thread starter ANU
  • Start date Start date
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
 
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)
 
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
 
Back
Top