Populate repeating table cell value after button insert - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Populate repeating table cell value after button insert

Last post 06-07-2013 04:55 AM by Tughsol. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-07-2013 01:29 PM

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

    Populate repeating table cell value after button insert

    Hello. Sorry (again) if the information for my question is already posted but I am new to Infopath (2007) and the examples I have found in the threads do not solve my issue...

    I have a repeating table with a button to insert a new row. Upon clicking the button, the current row is copied into the new row. However, I would like to overwrite a cell value. For example, on the current row is a value "Control 1" in the "Controls" field, when the button is clicked, i would like the "Control" value in the new row to be "Control 2". Below is the code i have:

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

    newRow.InsertAfter(Group);

    //the above works

    newRow.SelectSingleNode("my:Controls").Value = ("Control 2"); //this does not work

    Ideally i would like to end up with the control number being the current row + 1.

    I hope that makes sense, and any help is appreciated.

    Many Thanks, Matt.

  • 06-07-2013 04:55 AM In reply to

    Re: Populate repeating table cell value after button insert

    You can do this without using code.

    You would use the Concat Function to merge the word Control with the Preceding-Sibling Function (which will count the rows and add 1).

    The default value for that field would be: concat("Control ", count(preceding-sibling::*) + 1)

    I hope this helps.

    Thanks

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