I have a nested repeating table that I'm attempting to append rows to via C#. I'm very close to having it working properly, however, the issue I'm trying to resolve is: Each time a new row is appended to the nested repeating table, the new row has the correct values in its field, but the field of the first row is also changed to the same new value. The code uses the Clone() function to duplicate the first node and then attempts to reset the field value of that new node. However, when stepping through the code, I found that the field in the first row of the nested table is being reset as well. I'm on a different PC at the moment, so I can paste the exact code I'm using in a follow up. I just wanted to get this post created as my first action since joining the site tonight. Thanks for any input!
- - Update - - Code snippet with my understanding of each step (thanks for clarifications if my understanding is incorrect!)
XPathNavigator Group = e.Source.SelectSingleNode("my:TFLgroup", NamespaceManager) ; <-- Parent group of the repeating group
XPathNavigator table = Group.SelectSingleNode("my:assocTFLs", NamespaceManager); <-- Repeating group
XPathNavigator newRow = table.Clone(); <-- Cloning first row of repeating group newRow.SelectSingleNode("my:TFLname", NamespaceManager).SetValue(_temp); <--- Value update step; this also changes value of original first row
Group.AppendChild(newRow); <-- Appending new row to end of repeating group