Add item to numbered list box with c# or rules in Infopath? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Add item to numbered list box with c# or rules in Infopath?

Last post 02-17-2013 01:17 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-11-2013 07:08 AM

    Add item to numbered list box with c# or rules in Infopath?

    Hi I have an Infopath form with a number of drop down list boxes populated with different data. When a button is clicked I want the selected value taken from each drop down box and then added to a numbered list box. There will be a number of entrys to the numbered list box. How do i do this? I can only set the value of the numbered list box and so delete's the previous entry. Normally in c# it would be like: "Listbox.Items.Add", but not with infopath? Please help. Thanks
    Filed under: , ,
  • 02-17-2013 01:17 PM In reply to

    Re: Add item to numbered list box with c# or rules in Infopath?

    You don't need code to do this.

    Use Data->Default Values for your list box and add a bunch of blank ones. Add a conditional formatting to only show non blank. Add a rule to your button to set the value of the last list box row to the value of the dropdown. Use the xpath Count(../preceding-sibling::my:myListBox)+1 to get the last one (Note: myListBox) should be replaced with the correct field name for the repeating group node in your data source and you should be using a repeating group with a non repeating field underneath it for your list box - do not use a repeating field in a non-repeating group).

    If having blank rows bugs you, you can use qRules to insert one at a time when they click the button.

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