Index of ChildNode in a Tree

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Rakesh123
Posts: 63
Joined: Thu Oct 28, 2010 2:18 pm

Index of ChildNode in a Tree

Post by Rakesh123 » Wed May 01, 2013 8:14 am

Hi,

I want to get the child node index in a Tree.

For E.g.Elements in a tree are displayed as shown Below

-ParentNode1
-ChildNode1
-ChildNode2
|
|
|
-ChildnodeN
I want to get the index of childNode1.How can I get it using descriptive programming?

Pls respond ASAP.

Thanks,
Rakesh

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Index of ChildNode in a Tree

Post by Support Team » Thu May 02, 2013 4:16 pm

Hi,

If the index attribute is set to a value you can get it with the following method:
String index = childNode1.Element.GetAttributeValue("Index").ToString();
// or you could also use the ChildIndex attribute: 
String index = childNode1.Element.GetAttributeValue("ChildIndex").ToString();
Regards,
Markus
.
Image

Rakesh123
Posts: 63
Joined: Thu Oct 28, 2010 2:18 pm

Re: Index of ChildNode in a Tree

Post by Rakesh123 » Wed May 08, 2013 2:43 am

Thanks Markus,its working fine.... :D

The above problem is solved.Now I am moving one of the child Node from one parent node to another.

After moving from one parent to another the focus will be on the second consecutive child node.

I need to verify whether the focus is on second child node or not.

Pls help me in solving this ASAP


Thanks,
Rakesh

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Index of ChildNode in a Tree

Post by Support Team » Fri May 10, 2013 4:51 pm

Hello,

You can use the "HasFocus" property.
In order to set the focus on a specific element you can use the "Focus()" method.
Please let me know if you need any further information or assistance.

Regards,
Bernhard
.
Image