473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

TreeView control is slow

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
Jun 27 '08 #1
2 5229
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)

ANU wrote:
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
Jun 27 '08 #2
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

"bruce barker" wrote:
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)

ANU wrote:
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
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: orenwantsyou | last post by:
hi all, i have a c# winform application and a web appliaction. in the winform app. i use a treeview control, and in the web app. i use an htc control. the problem is that the winform application...
4
by: Aidan Marcuss | last post by:
I am seeing significant performance problems with the TreeView (from the Microsoft.Web.UI.WebControls namespace) when trying to data bind it on the server side. I set the TreeNodeSrc property and...
2
by: Anthony Fine | last post by:
Hello All, I would like to have a TreeView control on a form that autohides when the mouse leaves the area of the control, much like the Toolbox window in the VB.Net IDE. I have searched MSDN,...
3
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%""...
17
by: Spam Trap | last post by:
I am upgrading from VB6 where I had access to a treeview NodeClick event (see below)... but now VB.NET does not have this any more. Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)...
0
by: kenny | last post by:
Sanity Check please: Trying to resolve the following condition: Website initial page load is extremly slow (50 secs) when accessing site through CSS (load balancer) with http://alias. Code...
4
by: Henry | last post by:
Does anybody have a real-world sample of buiding a treeview control using data from database tables? All the sample code I have found either builds the treeview manually or uses a file directory...
0
by: Stuart Nathan | last post by:
I've written 2 separate TreeView Controls both of which are slow. Each consists of two parts - A Tree and a Leaf. In one the Tree is populated by individual leaves, which are drawn calculating...
2
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
Now we have to load the whole company's organizational relationships into one TreeView which has at lest 6~7 layer and including 300~400 nodes.In every node,there is a checkbox. So we need...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.