Re: Need working Treeview Code

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Grant Frisken (grant_at_infralution.com)
Date: 01/03/05


Date: Tue, 4 Jan 2005 09:58:53 +1100

If the total amount of data in your treeview is relatively small (<500
items) then you a probably better off loading all the data into a dataset
and sending it across the wire upfront - this will minimize the amount of
network roundtrips which will probably be the limiting factor in this case.
If you have a very deep tree with many items then you can improve
performance by only loading branches of the tree when the user expands them.
To do this you add a dummy node to each node which may have children and
handle the NodeExpand event to dynamically remove the dummy node and add the
real child nodes. This will mean the SQL queries (and network roundtrips)
are only done when you really need them (not all upfront). This still won't
help you if a node of the tree can have a large number of children - as you
will have to load all the children of a node when the user expands it. If
the node has 1000 children this may still be pretty slow.

If you are willing to consider a commercial solution then our VirtualTree
control can help solve these issues. It only loads the actual data required
for the currently displayed nodes. As the user scrolls through the tree or
expands items the additional data required is automatically loaded. I have
used this coupled with a data paging mechanism that retrieves pages of
objects from the server to very effectively balance minimizing network
roundtrips and amount data loaded. You can download a fully functional
trial version at:

http://www.infralution.com/products.html

Regards
Grant Frisken
Infralution

Reply

"Garrett" <anonymous@discussions.microsoft.com> wrote in message
news:145501c4e238$0a4c6040$a501280a@phx.gbl...
> Does anyone have any working TreeView code that loads
> nodes dynamically. I have a ton of info to move across
> the wire and can't seem to find any good examples.
> Microsoft's example only works with two levels.
>
> Thanks

begin 666 r.gif
M1TE&.#EA"P`+`)$#```+U+#Q__^_X/___R'Y! $```,`+ `````+``L```(7
9G(\CD2C F@)0/FHI3I?&TV55\WR<F10`.P``
`
end



Relevant Pages

  • loading a treeview in asp.net
    ... Can some one help me with loading a treeview in asp.net 2.0 ... All examples i have seen on the internet load the top node and then ... I would like to load the entire table into a tree view. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Websites
    ... put on a minute amount ... of family information, and another member of GR happened to be browsing ... tree matched with hers. ... researching their family history very willing and happy to help in any ...
    (soc.genealogy.britain)
  • Re: Globa Variables And TreeViews
    ... One is that your treeview has too much data ... The other is the amount of time it takes to build it. ... You should check out how much HTML is being ... Use the Application Cache; it's thread-safe. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Not really CHANGE, Same Old Shit Already
    ... If you had to supply resources to the large 200ft ... sustain this tree. ... Take for instance General Motors that for years and years persisted in ... by more people and use the same amount of resources to produce 3-4x ...
    (rec.bicycles.racing)
  • Opening Views
    ... I have a document that contains a large amount of data, ... manipulated in a tree view, however, I would like to occasionally view parts ... but I suspect this is somewhat of a hack and there is a better way ...
    (microsoft.public.vc.mfc.docview)