K
Kalpana
Hi All
I have a SharePoint List and I want the data to be copied over to a
Repeating Table in a Repeating Section. I have a button on the Repeating
Section and When I click the button my Repeating Table gets populated.
However this works only for the first Repeating Section. If I have a second
Repeating section I couldn't get the button click to work. It only works on
the first section.
Here is the code - I don't know how to get a handle of the current position
of the Repeating Section or table
public void btnSelectWorkCodes_Clicked(object sender, ClickedEventArgs e)
{
// Write your code here.
//Access Secondary Data Source for the Work COde Group list
xnWorkCodeGroup = this.DataSources["Work Codes
Group"].CreateNavigator();
XPathNodeIterator WCGNodes =
xnWorkCodeGroup.Select("/dfs:myFields/dfs:dataFields/dfs:Work_Codes_Group",
NamespaceManager);
XPathNavigator rowsNav =
xnDoc.SelectSingleNode("/my:myFields/my:group4/my:NewEngagement/my:grpWorkCodes", this.NamespaceManager);
//Remove all the rows in the repeating table first
XPathNavigator lastchild =
rowsNav.SelectSingleNode("child::*[position() = last()]",
this.NamespaceManager);
XPathNavigator firstchild =
rowsNav.SelectSingleNode("child::*[position() = 1]", this.NamespaceManager);
if (firstchild != null || lastchild != null)
firstchild.DeleteRange(lastchild);
while (WCGNodes.MoveNext())
{
string myNameSpace = NamespaceManager.LookupNamespace("my");
using (XmlWriter writer =
MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group4/my:NewEngagement/my:grpWorkCodes", NamespaceManager).AppendChild())
{
writer.WriteStartElement("rptWorkCodes", myNameSpace);
writer.WriteElementString("chkWCSelect", myNameSpace,
"false");
writer.WriteElementString("txtWCTitle", myNameSpace,
WCGNodes.Current.SelectSingleNode("@Title", NamespaceManager).Value);
writer.WriteEndElement();
writer.Close();
}
}
}
Thanks for any help.....I tried the various combition of current() but get
the Xslt error
Thanks
Kalpana
I have a SharePoint List and I want the data to be copied over to a
Repeating Table in a Repeating Section. I have a button on the Repeating
Section and When I click the button my Repeating Table gets populated.
However this works only for the first Repeating Section. If I have a second
Repeating section I couldn't get the button click to work. It only works on
the first section.
Here is the code - I don't know how to get a handle of the current position
of the Repeating Section or table
public void btnSelectWorkCodes_Clicked(object sender, ClickedEventArgs e)
{
// Write your code here.
//Access Secondary Data Source for the Work COde Group list
xnWorkCodeGroup = this.DataSources["Work Codes
Group"].CreateNavigator();
XPathNodeIterator WCGNodes =
xnWorkCodeGroup.Select("/dfs:myFields/dfs:dataFields/dfs:Work_Codes_Group",
NamespaceManager);
XPathNavigator rowsNav =
xnDoc.SelectSingleNode("/my:myFields/my:group4/my:NewEngagement/my:grpWorkCodes", this.NamespaceManager);
//Remove all the rows in the repeating table first
XPathNavigator lastchild =
rowsNav.SelectSingleNode("child::*[position() = last()]",
this.NamespaceManager);
XPathNavigator firstchild =
rowsNav.SelectSingleNode("child::*[position() = 1]", this.NamespaceManager);
if (firstchild != null || lastchild != null)
firstchild.DeleteRange(lastchild);
while (WCGNodes.MoveNext())
{
string myNameSpace = NamespaceManager.LookupNamespace("my");
using (XmlWriter writer =
MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group4/my:NewEngagement/my:grpWorkCodes", NamespaceManager).AppendChild())
{
writer.WriteStartElement("rptWorkCodes", myNameSpace);
writer.WriteElementString("chkWCSelect", myNameSpace,
"false");
writer.WriteElementString("txtWCTitle", myNameSpace,
WCGNodes.Current.SelectSingleNode("@Title", NamespaceManager).Value);
writer.WriteEndElement();
writer.Close();
}
}
}
Thanks for any help.....I tried the various combition of current() but get
the Xslt error
Thanks
Kalpana