Link to home
Start Free TrialLog in
Avatar of DPomeroy
DPomeroy

asked on

Navigating Treeview

How do I navigate up the path from a child node.  I need to get the path from the root of the tree to the farthest child, but I need to start at the child.  
Avatar of DPomeroy
DPomeroy

ASKER

Edited text of question
This is the second time I've asked this question.  I guess I wasn't clear the first time.
By farthest, do you mean the deepest child??  The one with the
longest search path??  I don't see how you'll be able to search for the child with the deepest search path starting at an arbitrary child.  If you start at the root, sure.

I suppose one could write an algorithm to start at all leaf nodes then progress to the root, finally giving you the leaf node (child) that had the longest path.
ASKER CERTIFIED SOLUTION
Avatar of sperling
sperling

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't know if this will work so its hard to grade.  Thanks for the help.  I didn't see parent in the treenodes property.  How did you figure out it had a parent property?
Thanks again.
Dave Pomeroy
Great answer.  I would like to pay for this information.  The answer is simple but I am learning the object part of Delphi and am struggling.  It helped a lot.  
>I don't know if this will work so its hard to grade. Thanks for

Try it out first, and then grade it. That's what you ought to do for all questions. If not, I could just give you a nonsense answer, and after grading it there's nothing you can do about it.

>the help. I didn't see parent in the treenodes property. How did
>you figure out it had a parent property?

I looked in the source ;)

Regards,

Erik.