Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fetch a TreeView
Message
From
20/01/1999 12:17:39
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00177882
Message ID:
00178083
Views:
26
>Hi,
>I need to print out all nodes of a treeview control with the correct indent and sorted like in the form.
>
>How can I do it ???
>
>Thank in advance for your help!!


You will have to read the Key value of each node and it's relationship to the other nodes. When you create a tree view, there is nothing to prevent you from just spinning up your tree view. However, I use a two column structure that I refer to as the "DNA" of the tree view data. Microsoft uses a similar methodology in the Solutions Sample for the tree view. *A fundamental difference between Microsoft's version and mine is where we make the necessary conversion to a character string. Key values in the tree view must be character strings, but the Entity ID is by its nature an integer value. It doesn't have to be but it makes life alot simpler. Microsoft makes this conversion when the id is created in the table. I store the values in the table as Integers, and convert them to character strings, padded with underscores as I build the tree view. Any way, the two columns are;

Entity_ID (Identifies the entity both in the data and in the tree view. This is the key value of the node)

ParentEntity (Identifies the entity to which this entity belongs both in the data and the tree view. This is the key value of the parent node).

A third column stores the Descriptive text for the data and the tree view.

By doing it this way, you have not only the data, but the relationships among the data stored in a table that can be accessed with normal set based rules. It also opens up many possibilities for reporting the data and its relationships.

It's just the way I do it, there are many others as well.

Regards,

Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Previous
Reply
Map
View

Click here to load this message in the networking platform