all groups > vj# > december 2004 >
You're in the

vj#

group:

Need working Treeview Code


Need working Treeview Code Garrett
12/14/2004 3:52:59 PM
vj#:
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.

Re: Need working Treeview Code Lars-Inge Tønnessen [VJ# MVP]
12/15/2004 11:18:19 PM

Please give us more info.


[quoted text, click to view]


I'm not sure what you want to do. What is the format of your ton of info.
Should the ton of info be presented in a GUI TreeView ? What do you mean
with "move across the wire"? Do you try to do GUI/WinForms programming or
network programming, or combine both?


[quoted text, click to view]


Do you have a link to that example ? I would like to see what you are trying
to do.



Regards,
Lars-Inge Tønnessen

Re: Need working Treeview Code George Birbilis [MVP J#] [9880]
12/16/2004 9:56:43 PM
[quoted text, click to view]

for starters search the web to see if related WinForms control can load
nodes dynamically instead of loading all the stuff at start (which might be
too much if you really have tons of data in that tree).

if you find positive info on that then try adapting any related sample code
you find to J# and if you fail post links/questions here

* if you're using Swing (J# Browser controls), you need to make your own
TreeModel interface implementation (pretty easy). I'm pretty sure JTree
doesn't load all the data at start, it polls your TreeModel implementation
instead when it needs data

cheers,
George

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <birbilis@kagi.com> [Microsoft MVP J#]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
.........................................................................

Re: Need working Treeview Code Grant Frisken
1/4/2005 9:58:53 AM
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


[quoted text, click to view]


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