XPath address for current row elements in repeating table

C

CherokeeKid

IP 2003 SP3
C# Managed code VS 2005
Web Service connected to SQL 2005 - AD0.NET DataSets

I am having trouble addressing the child nodes from the current row. I am
using a check box event(OnAfterChange) in a repeating table. My code is as
follows:

IXMLDOMNode WAKeyCurrent =
e.Site.selectSingleNode("..").firstChild; // This works and returns the first
child node correctly, but how do I get to any node but the first or last?

I am trying to get a date node that is thrid element in the row.
I have tried other elements as well, but get nothing.

// I have tried the following but they all return a null

IXMLDOMNode t3a = e.Site.selectSingleNode("reportDate");
IXMLDOMNode t3b = e.Site.selectSingleNode("../reportDate");
IXMLDOMNode t3c =
e.Site.selectSingleNode("/WAPrimary/reportDate");
IXMLDOMNode t3d =
e.Site.selectSingleNode("/WALookupDS/WAPrimary/reportDate");

IXMLDOMNode t3a1 = e.Site.selectSingleNode(".."); // this
returns the parent node


I am using a Web Service to populate the repeating table and this is a
Secondary data source.

Any ideas would be helpful.

Thanks
 
S

Shiva (GGK Tech)

Hello,
In OnAfterChange event you will get current row using below code,
IXMLDOMNode currentRow = e.site;

If you want any specific position number node then use below the code,
IXMLDOMNode parentNode = e.Site.parentNode;

IXMLDOMNode positionNode =
parentNode.selectSingleNode(“RepeatingNodeName[posistion() = 1]â€);
 

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

Top