Add dynamic records to Repeating table on button click using c# - InfoPath Dev
in

InfoPath Dev

Add dynamic records to Repeating table on button click using c#

Last post 12-02-2011 07:27 PM by stara. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-11-2008 11:28 AM

    • sreuben
    • Top 200 Contributor
      Male
    • Joined on 11-03-2008
    • Chennai
    • Posts 56

    Add dynamic records to Repeating table on button click using c#

     

    Hi,

    I have a infopath 2007 form that contains a repeating table that needs to be populated on click of the submit button. The values that needs to be populated comes from three textboxes eg. name, role, description that are present in the same form.

    When the user enters the first set of data and hits submit the values will be added to the first row of the repeating table. The second row should contain new set of values that are entered in the textboxes. I am using c# for coding.

    Is it possible to do such thing with repeating table? Kindly suggest.

  • 11-11-2008 10:18 PM In reply to

    Re: Add dynamic records to Repeating table on button click using c#

    It is possible, I would check the devlepors reference guide but why bother when Infopath already has controls for doing such a task.

    Typically in Infopath the user would just build the repeating list with the built in controls.

    Put drop downs in the three field in a repeating table.

    They set the first row, then insert a new row and pick the next combination, etc.

    That way no c# or anything to mess with or debug.

  • 11-11-2008 10:22 PM In reply to

    Re: Add dynamic records to Repeating table on button click using c#

    Hi, Get the last record of the repeating section using last() function. In that get the one field value. If that field value is blank then set the three text box values to the repeating nodes values like thisXDocument.DOM.selectSingleNode("/my:myFields/my:group1/my:group2[position() = last()]/my:field1").text = thisXDocument.DOM.selectSingleNode("/my:myFields/my:field4").text; here field4 -> is one of the text box field. Group2 -> repeating node If the last record field value is not empty then get the repeating node from sample xml and set the text box values in to that node and add that node to the parent node. IXMLDOMNode tempGroup2Node = ; tempGroup2Node.selectSingleNode("my:field1").text = thisXDocument.DOM.selectSingleNode("/my:myFields/my:field4"); //same for the remaining nodes group1Node.appendChild(tempGroup2Node);//adding the node to the parent node
    Swathip
    www.ggktech.com
  • 11-12-2008 12:09 PM In reply to

    • sreuben
    • Top 200 Contributor
      Male
    • Joined on 11-03-2008
    • Chennai
    • Posts 56

    Re: Add dynamic records to Repeating table on button click using c#

     

    Thanks. Your suggestion helped me a lot.

  • 12-02-2011 07:27 PM In reply to

    • stara
    • Top 200 Contributor
    • Joined on 10-20-2010
    • Posts 54

    Re: Add dynamic records to Repeating table on button click using c#

    Hi,

     

    I'm trying to do the same. Can you please post the entire code you're using?

     

    Thanks a lot

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