>I have an idea. I want to know if this is feasible to do? Before I get too far into it.
>
>I want to use a treeview to view records in a table.
>My table is just like a rolodex file with one rolodex card per person.
>I want three levels in my treeview. Here is an example.
>
>Top level of treeview has
>Fire Stations
>Police Stations
>Hospitals
>
>Next level down in treeview has
>Names of Fire Stations
>Names of Police Stations
>Names of Hospitals
>
>Bottom level of treeview has
>Names of Persons within each Fire Station
>Names of Persons within each Police Station
>Names of Persons within each Hospital
>
>Has anyone tried something like this? Is it difficult to do? I would like to make a form that does this. I would like to get the box with the plus sign in it as in the way the treeview works when using Windows Explorer. Thanks for the advice.
Not difficult. Read UT magazine June 2001 issue. ie:
Create Cursor treedata (NodeKey c(25), ParentKey c(25), NodeText c(50))
Select Distinct ;
padl(id1,6,'0')+'_', ;
padl(0,6,'0')+'_', ;
stationtype ;
from TreeSelect Into Array a1stLevel
Append From Array a1stLevel
Select Distinct ;
padl(id1,6,'0')+'_'+Padl(id2,6,'0')+'_', ;
padl(id1,6,'0')+'_', ;
stationname ;
from TreeSelect ;
into Array a2ndLevel
Append From Array a2ndLevel
Select Distinct ;
padl(id1,6,'0')+'_'+Padl(id2,6,'0')+'_'+Padl(id3,6,'0')+'_', ;
padl(id1,6,'0')+'_'+Padl(id2,6,'0')+'_', ;
personname ;
from TreeSelect ;
into Array a3rdLevel
Append From Array a3rdLevel
With This.OleTreeView
Scan
If Val(ParentKey) = 0
oNode=.nodes.Add(,tvwFirst,NodeKey,Trim(NodeText))
Else
oNode=.nodes.Add(ParentKey,tvwChild,NodeKey,Trim(NodeText))
Endif
Endscan
Endwith
Cetin