I want to mimic the functionality of the "Insert Item" function in
InfoPath for a repeating table using code triggered by a button
press. The reason is, I am designing forms for users which includes
people who don't have the best computer skills and may not notice or
know how to use this InfoPath function.
I have found the following code:
Dim row As XPathNavigator
row = MainDataSource.CreateNavigator.SelectSingleNode("/
my:myFields/my:group3/my:group4", NamespaceManager)
row.Clone()
Dim parent As XPathNavigator
parent = MainDataSource.CreateNavigator.SelectSingleNode("/
my:myFields/my:group3", NamespaceManager)
parent.AppendChild(row)
This works, but also adds any text entered in the child fields of
cloned node. I want to add a new row without any text. I have tried
individually changing the text values of the children nodes using
row.selectSingleNode("XPath").text, but text isn't compatible with the
XPathNavigator object.
I have very limited programming experience so I am not familiar with a
correct object or solution to what I am trying to achieve and would
appreciate some direction.