Adding new rows in the repeating table (programatically in Visual Basic) - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Adding new rows in the repeating table (programatically in Visual Basic)

Last post 02-26-2013 11:43 AM by Olgierd. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-26-2013 11:43 AM

    Adding new rows in the repeating table (programatically in Visual Basic)

    Hi,

    Hilary provided an example how to add new rows programatically in one of the posts. I adjusted the code accordingly and it works superfine:

    Dim xpath As String = "/my:PayPressureForm/my:General/my:NumberOfPeopleCoveredByRequest"            Dim field As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager)            'get the node you wish to have repeated            xpath = "/my:PayPressureForm/my:AdjustBaseSalary"            Dim group As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager)             'cast the field's value to an int to know how many rows to add            Dim rows As Integer = field.ValueAsInt            'loop, cloning group            Dim i As Integer            For i = 1 To rows - 1                Dim newRow As XPathNavigator = group.Clone()                newRow.InsertAfter(group)

                Next i

     Is there an additional line of code that I could add to first delete all rows?

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.