Microsoft InfoPath 2010
The official blog of the Microsoft InfoPath team

Introducing the Multi-Select List Box

Introducing the Multi-Select List Box

  • Comments 8
InfoPath 2007 introduces a new control, the multi-select list box, for cases when you want to allow users to select one or more items from the list of options. This list of options may be static, or may come from a data source. For example, you may use a multi-select list box to let the user pick the cities affected by the marketing campaign:
 
You may also allow users to specify items not on the list by going to Multi-Select List Box Properties, and setting the option to allow users to enter custom values:
 
Data source
Multi-select list box stores data in a repeating field. Every time a user checks an option, a new instance of the repeating field is added; every time an option is unchecked, a field is deleted. This is just like the Bulleted List control.
 
Let's analyze the data source at design time, and what goes into the XML when the form is filled out:
 
Form Design
Form Filling
Data Source Pane
User Input
Persisted XML
<my:campaign>
     <my:city>Chicago</my:city>
     <my:city>New York</my:city>
     <my:city>Boston</my:city>
</my:campaign>
  
Default Values
To specify which (if any) items should be checked in the multi-select list box by default, click Default Values on the Tools menu. Using the marketing campaign example, if you don't want any option to be selected by default, uncheck the only "city" item:
 
 
When you do this, you may see a design-time message that the "Control is bound to a missing field or group". You can safely ignore this message in this case since the point is to not have any checked by default.
 
If, instead, you want several options to be checked by default, right-click on the city item, then click "Add another city below", and specify default values for both cities:
 
 
Compatibility
Multi-select list boxes are supported only in InfoPath 2007 client.
 
- Alex Weinstein
Program Manager
Leave a Comment
  • Please add 6 and 7 and type the answer here:
  • Post
  • Yesterday I introduced the Multi-Select List Box&#160;and talked about how its data source is somewhat special:...
  • PingBack from http://microsoft.wagalulu.com/2006/07/14/multi-select-list-box-requiring-at-least-one-entry/
  • Have you ever created a form which allows the user to choose items from a list and&amp;nbsp;you wanted to...
  • Is it possible to do the opposite and make sure that a user does not select more than a certain number of options from the mult-select listbox?

  • Is there a way to make it all check upon loading the form

  • How can i select all the item in multi-select list?

  • Hello,

    I've searched the forums and can't find an answer for this.  Why is it taht when you look at the form in InfoPath (before deploying) the custom values box is pre-selected?  I don't want it to autocheck the custom value BEFORE the user adds one.  It should autocheck once the user starts typing a value.

  • Hi - I am using a multi-select list box for which I have to setup some default values. For several options to be checked, your suggestion above works when I type in the default value as you have done in the above example.

    However, when I use the "fx" function against the default value box and select some field (within infopath or MS SQL server database) I am not able to select different fields for different "city" fields. If I change the default value in one of the instances all of the default value changes.

    Any idea how to resolve this?

    Thanks!

Page 1 of 1 (8 items)