Home All Groups Group Topic Archive Search About
Author
19 Aug 2006 8:08 AM
Leon_Amirreza
I need to show more that 1,000,000 nodes in a .Net forms tree view control
i dont think its a good idea to load the whole data at once in the tree view
of course the data is load a from xml stream the load time is very fast but
dumping it onto the treeview dosent sound well
any better idea?!?!

i thought maybe to use treeview the way windows explorer (when you click +
sign beside a node that is actually a folder; the contents are read and
added to the treeview) but i dont how to get the tree view somthing like
that (of course i dont expect to accoplish it by changing a property value
or writting 1 or 2 line of code)
i dont have any idea what to do?
any helper class in .Net? appropriate event handler? any kind of data
binding to the tree view ? or ....

Author
18 Aug 2006 12:13 PM
Jeff Gaines
On 19/08/2006 Leon_Amirreza wrote:

Show quote
>I need to show more that 1,000,000 nodes in a .Net forms tree view control
>i dont think its a good idea to load the whole data at once in the tree
>view
>of course the data is load a from xml stream the load time is very fast
>but dumping it onto the treeview dosent sound well
>any better idea?!?!
>
>i thought maybe to use treeview the way windows explorer (when you click +
>sign beside a node that is actually a folder; the contents are read and
>added to the treeview) but i dont how to get the tree view somthing like
>that (of course i dont expect to accoplish it by changing a property value
>or writting 1 or 2 line of code)
>i dont have any idea what to do?
>any helper class in .Net? appropriate event handler? any kind of data
>binding to the tree view ? or ....


That's the way to do it - assuming your data fits into a parent/child type
relationship. Trap the expand event and load the children from there.

I have put an example of a file manager using this technique on the
CodeProject at:
http://www.codeproject.com/cs/files/JFileManager31.asp

if it's any help.

--
Jeff Gaines
Author
19 Aug 2006 1:30 AM
grant
Leon_Amirreza wrote:
> I need to show more that 1,000,000 nodes in a .Net forms tree view control
> i dont think its a good idea to load the whole data at once in the tree view
> of course the data is load a from xml stream the load time is very fast but
> dumping it onto the treeview dosent sound well
> any better idea?!?!
>
You can add a dummy child TreeNode for each folder node that you add -
this will ensure that the + symbol is displayed.   Then you can trap
the expand event, delete the dummy node and add the real child nodes.

This will only improve performance if you don't have a large number of
nodes under any one given node.   If you have this sort of scenario
then you should take a look at Infralution's Virtual Tree.   This is a
data driven control which is built from the ground up to only load the
data required to display the current tree display.  If you have
1,000,000 nodes on one level (eg under the root) it will still only
load the 30 or so required to display the current tree view - resulting
in almost instantaneous loading and minimal memory overhead.   You can
get more information and download an evaluation version from:

www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution

Show quote
> i thought maybe to use treeview the way windows explorer (when you click +
> sign beside a node that is actually a folder; the contents are read and
> added to the treeview) but i dont how to get the tree view somthing like
> that (of course i dont expect to accoplish it by changing a property value
> or writting 1 or 2 line of code)
> i dont have any idea what to do?
> any helper class in .Net? appropriate event handler? any kind of data
> binding to the tree view ? or ....
Author
20 Aug 2006 7:51 AM
Leon_Amirreza
I have thought of the dummy node the get + appear its good trick
I was wondering if there is more .Net like way to do it.

and the number of the child nodes may vary so the better idea is
the virtual tree since there are  still chances that the number of child
nodes of some nodes be around 40,000 or more but the total can be even more
than 1,000,000
of course having 1,000,000 as a child of root node is impractical but not
impossible

AND Most importantly the link brings up the "Page Can not be displayed"
i don know if anything went wrong or just the link is broken?!

<gr***@infralution.com> wrote in message
Show quote
news:1155951051.412420.153840@h48g2000cwc.googlegroups.com...
>
> Leon_Amirreza wrote:
>> I need to show more that 1,000,000 nodes in a .Net forms tree view
>> control
>> i dont think its a good idea to load the whole data at once in the tree
>> view
>> of course the data is load a from xml stream the load time is very fast
>> but
>> dumping it onto the treeview dosent sound well
>> any better idea?!?!
>>
> You can add a dummy child TreeNode for each folder node that you add -
> this will ensure that the + symbol is displayed.   Then you can trap
> the expand event, delete the dummy node and add the real child nodes.
>
> This will only improve performance if you don't have a large number of
> nodes under any one given node.   If you have this sort of scenario
> then you should take a look at Infralution's Virtual Tree.   This is a
> data driven control which is built from the ground up to only load the
> data required to display the current tree display.  If you have
> 1,000,000 nodes on one level (eg under the root) it will still only
> load the 30 or so required to display the current tree view - resulting
> in almost instantaneous loading and minimal memory overhead.   You can
> get more information and download an evaluation version from:
>
> www.infralution.com/virtualtree.html
>
> Regards
> Grant Frisken
> Infralution
>
>> i thought maybe to use treeview the way windows explorer (when you click
>> +
>> sign beside a node that is actually a folder; the contents are read and
>> added to the treeview) but i dont how to get the tree view somthing like
>> that (of course i dont expect to accoplish it by changing a property
>> value
>> or writting 1 or 2 line of code)
>> i dont have any idea what to do?
>> any helper class in .Net? appropriate event handler? any kind of data
>> binding to the tree view ? or ....
>
Author
19 Aug 2006 10:56 PM
Grant
Leon_Amirreza wrote:
> I have thought of the dummy node the get + appear its good trick
> I was wondering if there is more .Net like way to do it.
>

I think this is the best you can do without completely rewriting the
treeview control

> and the number of the child nodes may vary so the better idea is
> the virtual tree since there are  still chances that the number of child
> nodes of some nodes be around 40,000 or more but the total can be even more
> than 1,000,000
> of course having 1,000,000 as a child of root node is impractical but not
> impossible
>
> AND Most importantly the link brings up the "Page Can not be displayed"
> i don know if anything went wrong or just the link is broken?!

I just checked the link and it seems OK.  If it is still not working
for you please let us know - what country are you coming from?

Show quote
> <gr***@infralution.com> wrote in message
> news:1155951051.412420.153840@h48g2000cwc.googlegroups.com...
> >
> > Leon_Amirreza wrote:
> >> I need to show more that 1,000,000 nodes in a .Net forms tree view
> >> control
> >> i dont think its a good idea to load the whole data at once in the tree
> >> view
> >> of course the data is load a from xml stream the load time is very fast
> >> but
> >> dumping it onto the treeview dosent sound well
> >> any better idea?!?!
> >>
> > You can add a dummy child TreeNode for each folder node that you add -
> > this will ensure that the + symbol is displayed.   Then you can trap
> > the expand event, delete the dummy node and add the real child nodes.
> >
> > This will only improve performance if you don't have a large number of
> > nodes under any one given node.   If you have this sort of scenario
> > then you should take a look at Infralution's Virtual Tree.   This is a
> > data driven control which is built from the ground up to only load the
> > data required to display the current tree display.  If you have
> > 1,000,000 nodes on one level (eg under the root) it will still only
> > load the 30 or so required to display the current tree view - resulting
> > in almost instantaneous loading and minimal memory overhead.   You can
> > get more information and download an evaluation version from:
> >
> > www.infralution.com/virtualtree.html
> >
> > Regards
> > Grant Frisken
> > Infralution
> >
> >> i thought maybe to use treeview the way windows explorer (when you click
> >> +
> >> sign beside a node that is actually a folder; the contents are read and
> >> added to the treeview) but i dont how to get the tree view somthing like
> >> that (of course i dont expect to accoplish it by changing a property
> >> value
> >> or writting 1 or 2 line of code)
> >> i dont have any idea what to do?
> >> any helper class in .Net? appropriate event handler? any kind of data
> >> binding to the tree view ? or ....
> >

AddThis Social Bookmark Button