Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
i have a treeview with nodes and child nodes.each node have values in tags.how can i get all child node valus of a selected node (as a datatable etc.)
Posted

1 solution

I suppose you have the selected TreeNode...

Each TreeNode has a Nodes collection, which consists of a collection of the TreeNode's childnodes. That is how to access them...

check out this link: http://msdn.microsoft.com/en-us/library/system.windows.forms.treenode.aspx[^]

Grtz, Perry
 
Share this answer
 
Comments
Abdul Rahman Hamidy 30-Apr-11 4:12am    
you can loop and do recursion... and use TreeNode properties.
RAJI @Codeproject 30-Apr-11 4:49am    
thanksss!!!!!!!
Dinesh Raina 12-May-16 5:04am    
Please check below url
http://stackoverflow.com/questions/1372363/accessing-all-the-nodes-in-treeview-control

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