Click here to Skip to main content
15,891,738 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a Treeview with rootnode and child nodes.I am adding some files for each and every nodes.
Now my question is--after adding documents to the particular node i need to expand that node only not all parent nodes.how to do? please help me asap.


Thanks All.
Posted
Updated 7-Jan-10 4:13am
v2

1 solution

The TreeNode class has an Expand method, you could use that and walk up the tree using the Parent property to expand all parents. Optionally you could use the EnsureVisible method which does all of that for you. (edited, you only want to expand child nodes, not parent nodes).

You should really try reading the documentation[^] sometime. It'll help you discover the answers to question like this all by yourself.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900