Programmatically adding rows to the *top* of a repeating table - InfoPath Dev
in

InfoPath Dev

Programmatically adding rows to the *top* of a repeating table

Last post 02-04-2016 08:55 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-02-2016 08:20 AM

    Programmatically adding rows to the *top* of a repeating table

    Good day folks, I am new to Infopath development and our environment dictates that we use *Infopath 2007 *VisualStudio 2008 *VBScript for the programming language. We are trying to programmatically insert rows at the top of a repeating table. We reused the code posted by Jimmy Rishe on http://www.infopathdev.com/blogs/jimmy/archive/2009/03/06/automatically-adding-rows-to-repeating-sections.aspx However it adds rows to the end of the table. Is there a way to add rows to the top of the table? If so, please could you provide instructions. Many thanks, Gaurav
  • 02-04-2016 07:46 AM In reply to

    Re: Programmatically adding rows to the *top* of a repeating table

    https://msdn.microsoft.com/en-us/library/office/microsoft.office.infopath.actiontype.aspx has the ActionType enumeration class, which includes XCollectionInsertBefore - there may be a way to manipulate with that?

    Hilary Stoupa

  • 02-04-2016 08:03 AM In reply to

    Re: Programmatically adding rows to the *top* of a repeating table

    Thank you Hillary, I replaced thisXDocument.View.ExecuteAction("xCollection::insert", "group12_778") with thisXDocument.View.ExecuteAction("xCollection::insertBefore", "group12_778") I get the error: The specified bstrAction value for the View.ExecuteAction call is not applicable for the current selection. Any ideas on how to set the context or pointer or selection? Thanks G
  • 02-04-2016 08:55 AM In reply to

    Re: Programmatically adding rows to the *top* of a repeating table

     https://msdn.microsoft.com/en-us/library/aa942991(v=office.11).aspx says:

    It is possible to first set the selection context by using the SelectNodes method or SelectText method, then call the ExecuteAction method to act on that context.

    Perhaps the code sample there will help you get an idea of what you need to do? Sorry, I don't use VBScript and don't know offhand. 

    Hilary Stoupa

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