Board index » cppbuilder » How to create a TreeView dynamically in such situation (Hierarchical tree)?

How to create a TreeView dynamically in such situation (Hierarchical tree)?


2003-08-28 02:36:09 PM
cppbuilder28
Dear all,
If I have a "hierarchical tree", ex:
A
/ \
B C
/ / | \
C D E F
/ | \ / \
D E F G H
/ \
G H
A's child:B,C.
B's child:C.
C's child:D,E,F.
F's child:G,H.
others' child: NULL.
Because we just know 1 level relation in such case,
how can I hanle the the subtree of right C?
Is there some trick to implement it as a TreeView?
Thanks for your answer.
Best Regards,
Cylin.
 
 

Re:How to create a TreeView dynamically in such situation (Hierarchical tree)?

Dear all,
If I have a "hierarchical tree", ex:
A
/ \
B C
/ / | \
C D E F
/ | \ / \
D E F G H
/ \
G H
A's child:B,C.
B's child:C.
C's child:D,E,F.
F's child:G,H.
others' child: NULL.
Because we just know 1 level relation in such case,
how can I hanle the the subtree of right C?
Is there some trick to implement it as a TreeView?
Thanks for your answer.
Best Regards,
Cylin.
 

Re:How to create a TreeView dynamically in such situation (Hierarchical tree)?

Hi cylin
Sorry but I don't understand your post exactly. Are you ask how you would
dynamically propagate a TreeView control with such a data formation /
"hierarchical tree" OR are you asking how you would differentiate between
different nodes on a TreeView control, at run-time, based on the fact that
there may be more than one node with the same name i.e. C?
"cylin" < XXXX@XXXXX.COM >wrote in message
Quote
Dear all,

If I have a "hierarchical tree", ex:

A
/ \
 

{smallsort}

Re:How to create a TreeView dynamically in such situation (Hierarchical tree)?

Hi Mike,
I mean if we have the following relations.
A's child:B,C.
B's child:C.
C's child:D,E,F.
F's child:G,H.
others' child: NULL.
How to build a TreeView like below?
A
/ \
B C
/ / | \
C D E F
/ | \ / \
D E F G H
/ \
G H
Of course, if the nodes are few, we can draw a tree first.
Then create a TreeView using this tree.
But if we have a lot of nodes, how do I build a TreeView?
("dynamically creating" is not the point here.)
Thanks.
Best Regards,
Cylin.
"Mike Collins" < XXXX@XXXXX.COM >glsD
: XXXX@XXXXX.COM ...
Quote
Hi cylin

Sorry but I don't understand your post exactly. Are you ask how you would
dynamically propagate a TreeView control with such a data formation /
"hierarchical tree" OR are you asking how you would differentiate between
different nodes on a TreeView control, at run-time, based on the fact that
there may be more than one node with the same name i.e. C?

"cylin" < XXXX@XXXXX.COM >wrote in message
news:bikd3n$a2op1$ XXXX@XXXXX.COM ...
>Dear all,
>
>If I have a "hierarchical tree", ex:
>
>A
>/ \