How to: Create a List of Values for a Field in a LightSwitch Application
When you develop an application in Visual Studio LightSwitch, you can create a choice list so that users can choose a value from a specific set instead of entering a value into a text box.
To create a choice list for a field
In Solution Explorer, open the shortcut menu for an entity or table, and then choose Open.
The entity or table opens in the Data Designer.
Note
For applications that have been upgraded to Visual Studio 2012 Update 2, on the Perspective bar, choose the Server tab.
In the Data Designer, choose a field (for example, PostalCode).
In the Properties window, choose the Choice List link.
The Choice List dialog box appears.
In the choice-list table, choose Add Value, and then enter any value (for example, 98052).
In the same row, choose Display Name, and then enter the name that you want to appear for this item in the list.
To add more values to the list, repeat the previous two steps.
The following illustration shows values in the Choice List dialog box.
Choose the OK button to close the Choice List dialog box.
To remove a choice list from a field
In Solution Explorer, open the shortcut menu for an entity or table, and then choose Open.
The entity or table opens in the Data Designer.
Note
For applications that have been upgraded to Visual Studio 2012 Update 2, on the Perspective bar, choose the Server tab.
In the Data Designer, choose the field that uses a choice list.
In the Properties window, choose the X that appears next to the Choice List link.
See Also
Tasks
How to: Add a Computed Field in a LightSwitch Database
How to: Define Data Fields in a LightSwitch Database