Add a Drop-down list to a table column
Use the drop-down list to change the content of a row in a table with multiple rows.
The following example shows a list of digital camera products. Each digital camera has more than one free add-on associated with it. After the user selects a camera, they can select the free add-on from the related drop-down list.
To use a drop-down list, store the information in a previously defined database, .NET method, or Web service call.For example, when creating a Staff Location Details table, enter the location details for each Staff member. Office location details appear in the Location table of the database. Map the Location column of the Staff Location Details table to the Location table of the database.
At runtime, when you add a row to the Staff Location Details table and enter location, the drop-down list is populated with the contents of the Location table. You can then select the location for a specific staff person.
For example, if Bryan Walsh works in the London office, select London from the Location list.
- Add columns to a table.
- On the Data type list, select String.
- On the Type list, select Drop-down.
Display mode list, select
Value and text.
For Value and text, additionally provide Text width% and Value width%.
Data source list, select
one of the following options:
This option is available for normal and capture forms. You can dynamically populate the drop-down list for capture table cell of a choice type. However, for forms prior to 7.6.0, the default value set in the static data source is applied even if the dynamic data source is configured. You must regenerate the forms to allow dynamic population of data.
Dynamic: To use dynamic data in a drop-down list in a table column, create or select a .NET method, Web service, or DB query action.The used action should return array type parameter. Assign the Table to the return array parameter. Select the <TableName.TableColumn.Text> and <TableName.TableColumn.Value> properties in the required array columns.
Lookup: To use a predefined lookup, click Lookup and select the lookup to use. See Manage a lookup.
Static: To use a static value, do the following:
Enter a Name and Value that appears on the drop-down list at runtime. For example, Please select.
Click Add .
The item is added to the list. Create as many items as required.
To make the item as default, on the list of items, click the Default button for the item. This item populates the field by default at runtime. For example, for a Title list, add the static items, such as Mr., Mrs., Miss, and select Mrs as the default.
To reorder the list, use the icons. By default, the drop-down list items appear in the order in which they are defined.
- Click Save.