Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hierarchy Structure
Message
From
28/10/1997 16:54:17
 
 
To
13/10/1997 14:39:59
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00054095
Message ID:
00057121
Views:
29
Hi Ariel
This is really simple. You want to keep hierarchical data in a database and later populate a visual treeview contro.
The structure of the database should be as follows
code char( 10) && or any other suitable field
Description char(50)
parentcode char(10) && this should be another valid code. this is a recursive relationship
The parentcode will be blank for the root node or the first entry in your hierarchy.
Sample code for this is available in foxpro solutions.app
>>>i want to make a tree view with a simple way using prints....
>>>
>>>anyone can do for me an example?
>>>
>>>an example is the way that you see the messages here, in universal
>>>thread....
>>
>>First you need a data structure to keep it in - a .dbf with a regular
>>key, and another field with the other record's key. Now you have to
>>write something recursive to fill in for the keys, and something
>>recursive to read it and display indented (one level of indentation for
>>each level of recursion). It's kind of tricky until you do it once.
>>
>>I've done that some seven years ago, it was used for documenting the
>>app's menu tree. Later it got used for any btree search, but basically
>>it still uses menu.dbf, which didn't change much over the years. Now I'm
>>using the same engine to fill a treeview from (guess) menu.dbf :), but
>>it seems treeview is not best of all, because it's a foreign tissue in
>>VFP.
>>
>>The trick consists mainly of an array which keeps the location where you
>>start next level of recursion (i.e. a node with children) from, so when
>>you return, you know where you branched off. Could send you the code, if
>>this sounds interesting enough.
>
>yes, if u can... i think that will be enough
>
>Thnks for reply.
>Ariel Pablo Klein
>Argentina
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform