Home All Groups Group Topic Archive Search About

How to load hierarchical Db data in treeview??

Author
17 Feb 2006 6:38 AM
Don
In a previous version of vb I used to save and load hierarchical data
from an Access db into a treeview. But, I never found a very
satisfying or elegant way to do it. I used a flat file approach with
each item  having a reference to its parent node. I would then start
by loading the top level nodes folowed by loading child node data only
as their parent node was expanded.

This method worked fairly well except that allowing the user to drag a
node from one parent to another meant having to update the record's
parent and hope you could catch any boogers that may occur.

Loading child nodes as needed works just fine but is there a better
way to do all this hocus pocus with vb.net 2003? I've started to learn
vb.net about 13 times over the last few years but have not put much
time into it.

Thank you for any non profane help, <g>

    Don

(Just kidding about the @#$% profanity)

Author
17 Feb 2006 1:17 PM
Peter Proost
Hi, do a search on this group with google on "treeview recursive loop"
this should get you started

Hope this helps
Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

Show quoteHide quote
"Don" <don81846@NO_CaCa.Earthlink.net> schreef in bericht
news:q8qav11a7aeosnk3ag1v6bj9ijiqclhq02@4ax.com...
>
> In a previous version of vb I used to save and load hierarchical data
> from an Access db into a treeview. But, I never found a very
> satisfying or elegant way to do it. I used a flat file approach with
> each item  having a reference to its parent node. I would then start
> by loading the top level nodes folowed by loading child node data only
> as their parent node was expanded.
>
> This method worked fairly well except that allowing the user to drag a
> node from one parent to another meant having to update the record's
> parent and hope you could catch any boogers that may occur.
>
> Loading child nodes as needed works just fine but is there a better
> way to do all this hocus pocus with vb.net 2003? I've started to learn
> vb.net about 13 times over the last few years but have not put much
> time into it.
>
> Thank you for any non profane help, <g>
>
> Don
>
> (Just kidding about the @#$% profanity)
Author
18 Feb 2006 3:35 AM
Grant Frisken
If you are open to commercial solutions take a look at Infralution's
Virtual Tree control.  It has a really elegant databinding mechanism
that allows you to bind easily to hierarchical data from a Database.

You can get more information and download a fully functional evaluation
version from:

www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution

Don wrote:
Show quoteHide quote
> In a previous version of vb I used to save and load hierarchical data
> from an Access db into a treeview. But, I never found a very
> satisfying or elegant way to do it. I used a flat file approach with
> each item  having a reference to its parent node. I would then start
> by loading the top level nodes folowed by loading child node data only
> as their parent node was expanded.
>
> This method worked fairly well except that allowing the user to drag a
> node from one parent to another meant having to update the record's
> parent and hope you could catch any boogers that may occur.
>
> Loading child nodes as needed works just fine but is there a better
> way to do all this hocus pocus with vb.net 2003? I've started to learn
> vb.net about 13 times over the last few years but have not put much
> time into it.
>
> Thank you for any non profane help, <g>
>
>     Don
>
> (Just kidding about the @#$% profanity)