TreeView

ddrew

seasoned user
Local time
Today, 09:33
Joined
Jan 26, 2003
Messages
911
Wonder if someone can help with TreeViews. I'm new to them and need help. I have two tables tbl_SimType and tbl_Sim. tble_Sim is the child of tbl_Sim.
I want to show a treeview with checkboxes with the partent from tdl_SimType with its children from tbl_Sim.

Ultimatley this needs to be stored in a table which, having looked about should be done with an append query
 
Hi,

i read this article, and for me it still didn´t help. Maybe because I have other data and his data keeps confusing me. Anyway i wonder how i could make a treeview of SON_ID and DAD_ID, and son-id is usually also the "parent" as it goes down.

my data looks something like this

DAD_ID SON_ID
TROOT _____183
183 ________95
95 _________5790
5790 _______5967
5790 _______3161
5790 _______7950
5790 _______1515
790 ________2502
2502 _______2501
2502 _______87
95 _________2517

any ideas???
 
Last edited:
I don't think you can really get anywhere with DadID and SonID as useful ID field names, since dad and son are only defined as a matter of perspective. A son can be a dad and a dad can be a son so to uniquely identify an object as one or the other of those things is necessarily incomplete. I would expect data to look like...
Code:
[B]tMalePerson[/B]
MalePersonID
DadID
Name
In this design each single MalePerson record may point to a unique Dad. One dad might have many MalePerson records linked to him. This structure is indeed hierarchical, allows for a single record in a single table to function as a single authoritative repsentation of the unique MalePerson, who, depending on other data may function as son or dad as the case may be.
hth
mark
 
Ok, that didn´t quite help me :)
I need the data to lookl like this:

183
____95
_______5790
____________5967
____________3161
____________7950
____________151
____________2502
_________________2501
_________________87
_______2517


And 183 is the first level, and so on.


Any ideas?? Suggestions?
 
Just curious.
If ddrew started this and dani9 is having trouble getting it to show data properly,
is this a school project or has ddrew dropped out of this???

I agree with BigJohn the treeview blogspot is a good reference. It does build one session upon the previous to help with concepts. Also, there aren't many Treeview examples out there. Would also suggest, if anyone has a tutorial on Treeview, it would be a good candidate for Code Repository or Sample Databases here at AWF.
 
The structure you want is called hierarchical. The simplest implementation is using a single table that links to itself to define its parent-child relationships. This table will have a structure like ...
tHierarchicalData
RecordID (Primary Key)
ParentRecordID (Foreign Key, linking to primary key in this same table)
Data
The simplest way to traverse heirarchical structures is using recursion.
So that leaves you with a few terms you can google too.
Best of luck,
Mark
 
I've attached a collection of different treeview db's I gathered from my travels around the internet researching how to do treeviews -

None of them are mine - they were made by others - hope you find them educational.

There is one really good treeview tutorial site - I don't have the URL on me now - but will post it tomorrow when I'm in work.

Happy learning!
 

Attachments

actually BigJohn's reference to the treeview blogspot was the site I was thinking off -
 
thanks guys, this helped a lot.

and it is not a school project, I just didn´t want to opet a new post, because i have the same problem.

thanks again!!
 

Users who are viewing this thread

Back
Top Bottom