Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to select particular Node and its child nodes in TreeView of ASP.Net 2005 ?

Reply
Thread Tools

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

 
 
Luqman
Guest
Posts: n/a
 
      06-05-2007
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




 
Reply With Quote
 
 
 
 
AlexS
Guest
Posts: n/a
 
      06-05-2007
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
}
}


"Luqman" <> wrote in message
news:%...
>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
>
>
>
>



 
Reply With Quote
 
 
 
 
Luqman
Guest
Posts: n/a
 
      06-05-2007
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


"AlexS" <> wrote in message
news:...
> 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
> }
> }
>
>
> "Luqman" <> wrote in message
> news:%...
>>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
>>
>>
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
XSL select only nodes which contain a specific child node William Krick XML 4 03-18-2011 09:54 AM
select nodes with child node A and child node B gplott@yahoo.com XML 1 11-01-2006 09:27 PM
problem with child text node when constraining other child node types Bryan Ax XML 6 05-17-2006 09:08 PM
change the icon of a JTree parent node according to its child nodes esamsalah@gmail.com Java 1 03-31-2005 02:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57