ROOT
A
B
C
D
E
T
F
G
X
I want to find E Node’s parent nodes(it is number 5). Then, I’ll save node. If number is smaller 5. I’m using TreeView in Asp.net control.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would suggest using recursive iterations.
You can utilize this logic to determine many things about you node and this structure also allows you to expand what you can do with the node and the criteria you wish to search for. You can edit my example to fit your own needs.
Thus, with this example you could pass in E and expect to have the node E returned then simply
if the parent property of the node returned would be the parent you are after.
tn.parentis the value you are after.