How to select particular Node and its child nodes in TreeView of ASP.Net 2005 ?

L

Luqman

I have filled a treeview with parents and childs, using Hashtables.

Now, how can I check the required Parent and its Child Nodes.

for example, I have following data

Group
Item A
Item A1
Item A2
Item B
Item B1
Item B2

Now, I want to check the Item B, Item B1 and Item B2 Only, how can I ?

I have also saved the Keyvalues in the nodes, but still I don't know, how to
go to Item B ?
I know, that Item B has a Keyvalue B.

Any Idea please ?

Best Regards,

Luqman
 
A

AlexS

Is that what you're looking for?

foreach (TreeNode tn in tree.Nodes) {
if (tn.Text == "Item B") {
// you found it and can go for B1-Bn
}
}
 
L

Luqman

Hi,

for each loop will not find "Item B" as in VS 2005, the Group Node is the
Tree Main Node while Item A and Item B are childnodes of Group Node.

Best Regards,

Luqman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top