Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Treeview to view records in a table?
Message
De
26/02/2002 13:35:01
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00623277
Message ID:
00625320
Vues:
11
>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:
* Cursor treeselect have all levels
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform