Hello there,
I hope this is the correct forum to post an issue that I'm trying to resolve. I'm trying to figure out how to send data from one repeating table to another. Ideally I would like for the user to be able to select item(s) from Table A and has/have it transfer to Table B upon clicking on the Add button. Table A will have checkbox for user to select one or multiple items.
I tried searching the web and found a few solutions using C#, but I'm still unable to get it to work correctly. When I run my codes, the system seems to freeze. I'm still new to programming so any help you can provide is greatly appreciated. Thanks!

Structure: Two Tables: Table A and Table B. Table A has A1, A2, and A3 fields. Table has B1, B2, and B3 fields.
Code:
public void Add2_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator mainDS = MainDataSource.CreateNavigator();
XPathNavigator selectedRow = mainDS.SelectSingleNode("/my:myFields/my:TableA/my:FieldsA[my:A1 = 'true']", NamespaceManager);
while (selectedRow != null)
{
string A1 = selectedRow.SelectSingleNode("/my:myFields/my:TableA/my:FieldsA/my:A1", NamespaceManager).Value;
string A2 = selectedRow.SelectSingleNode("/my:myFields/my:TableA/my:FieldsA/my:A2", NamespaceManager).Value;
string A3 = selectedRow.SelectSingleNode("/my:myFields/my:TableA/my:FieldsA/my:A3", NamespaceManager).Value;
XmlDocument doc = new XmlDocument();
XmlNode FieldsB = doc.CreateElement("FieldsB", NamespaceManager.LookupNamespace("my"));
XmlNode field = doc.CreateElement("B1", NamespaceManager.LookupNamespace("my"));
XmlNode node = FieldsB.AppendChild(field);
node.InnerText = A1;
field = doc.CreateElement("B2", NamespaceManager.LookupNamespace("my"));
node = FieldsB.AppendChild(field);
node.InnerText = A2;
field = doc.CreateElement("B3", NamespaceManager.LookupNamespace("my"));
node = FieldsB.AppendChild(field);
node.InnerText = A3;
doc.AppendChild(FieldsB);
MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:TableB", NamespaceManager).AppendChild(doc.DocumentElement.CreateNavigator());
}
selectedRow = mainDS.SelectSingleNode("/my:myFields/my:TableA/my:FieldsA[my:A1 = 'true']", NamespaceManager);
}