Page 1 of 1

Index of ChildNode in a Tree

Posted: Wed May 01, 2013 8:14 am
by Rakesh123
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

Re: Index of ChildNode in a Tree

Posted: Thu May 02, 2013 4:16 pm
by Support Team
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

Re: Index of ChildNode in a Tree

Posted: Wed May 08, 2013 2:43 am
by Rakesh123
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

Re: Index of ChildNode in a Tree

Posted: Fri May 10, 2013 4:51 pm
by Support Team
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