Repeating table - "Insert row after" code - InfoPath Dev
in

InfoPath Dev

Repeating table - "Insert row after" code

Last post 01-07-2014 10:51 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-02-2014 06:49 AM

    • MattyG
    • Not Ranked
    • Joined on 05-07-2013
    • Posts 6

    Repeating table - "Insert row after" code

    Hi there and Happy new year !

    On a repeating table, there is the option to insert a new row after the current row. I am trying to do this in code but cannot get it to work. The reason I am doing it in code is because I am copying values from the current row into the new row. I am trying to use a button to perform this. There is a button on each row, so when the user clicks it, a new row is inserted after that row (not after the last row in the table).

    My data source looks like this:

    • myfields
      • NewAssessments
        • NewAssessment
          • Title
          • RiskNo
          • LineNumber
          • RAVersion
          • Year

    I have code like the following:

    XPathNavigator Group = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:NewAssessments/my:NewAssessment[current()]", NamespaceManager);XPathNavigator newRow = Group.Clone();

    newRow.InsertBefore(Group);

     

    Any help would be appreciated. Thank you.

  • 01-07-2014 10:51 AM In reply to

    Re: Repeating table - "Insert row after" code

    I'm assuming the code is on the button and the button is inside the repeating NewAssessment table / section?

    XPathNavigator Group = e.Source;

    XPathNavigator newRow = Group.Clone();

    newRow.InsertBefore(Group);

    Hilary Stoupa

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