المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to find a Node in treeview



C# Programming
07-26-2011, 06:31 PM
Hi,

I'm trying to find a particular node in treeview. I used below code to find out, but not working. Please let me know how to find out. Thanks in advance
approach 1:
treeView1.Nodes.Find("Company", true)
approach 2: it is searching at only one level, not child nodes
foreach ( TreeNode tn in theTreeView.Nodes ) { if ( tn.Text == "Company" ) { return tn; }}My treeview:
Business |__Company | |__BBS | |__CBS |__Prod