Click here to Skip to main content
15,903,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi To ALL,
I have treeview in widowsform application when searching for node is performed i need to hide all the remainig node and i need to show only the searched node and its parent .like

grandParent
Parent1
child1
child2
child3.
parent2
child4
child5
if the searched node is <b>child 3</b> i need to show the out put as..


grandParent
Parent1
child3
all auother are to be Hide..
is any one worked on this pls Help me......
Thank in advance...
Posted
Updated 28-Aug-11 19:49pm
v3
Comments
Sergey Alexandrovich Kryukov 26-Aug-11 11:52am    
Please add a tag: WinForms (use "Improve question")
--SA
Sergey Alexandrovich Kryukov 26-Aug-11 11:56am    
By "hiding", do you mean collapsing all nodes which does not have to be shown, or you need complete hiding? If this is complete hiding, how do you want to show them again? I would thing complete hiding would be very confusing.
--SA
rajesh.r4321 29-Aug-11 1:50am    
By hiding

1 solution

That is not how a tree view normally works - you don't hide siblings at the same level.
If you must do this, then the best way is to construct a new TreeView which only shows the searched for node, and it's parents.
 
Share this answer
 
Comments
agent_kruger 21-Feb-14 1:53am    
we can hide the child node but i don't it yet otherwise on "treeview1.Nodes" it should not have displayed "IsVisible" property.

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