Hi,
I have a repeating table in my InfoPath form where users fill out
data. When they click a button I want to populate a different repeating
table within the same form (using only some columns but all rows)
Im using C# code (below) to do this (wont have Qdabra for the near future) and at the moment Im getting no results - when the user clicks the button nothing happens.
The populated table = /my:Sect_Main/my:RequestDetails/my:Products/my:Product
The table I want to populate =/my:Sect_Main/my:RequestDetails/my:Sect_Retailers/my:RetailerProducts
-------------------------------------------------------
XPathNavigator rootMain = MainDataSource.CreateNavigator().SelectSingleNode("/my:Sect_Main/my:RequestDetails/my:Products/my:Product", NamespaceManager);
XPathNavigator rootSecondary = MainDataSource.CreateNavigator().SelectSingleNode("/my:Sect_Main/my:RequestDetails/my:Sect_Retailers/my:RetailerProducts", NamespaceManager);
// Select nodes in specified XPathNavigator.
XPathNodeIterator selectedNodes = rootSecondary.Select("/my:Sect_Main/my:RequestDetails/my:Sect_Retailers/my:RetailerProducts", NamespaceManager);
XmlWriter writer = rootMain.SelectSingleNode("/my:Sect_Main/my:RequestDetails/my:Products/my:Product", NamespaceManager).AppendChild();
string myNamespace = NamespaceManager.LookupNamespace("my");
foreach (XPathNavigator node in selectedNodes)
{
writer.WriteStartElement("Products", myNamespace);
writer.WriteElementString("Products_ProductName", myNamespace, node.GetAttribute("Retailers_ProductName", ""));
writer.WriteEndElement();
} -----------------------------------------
Any help would be much appreciated!
Thanks,
Ciara