This article describes how to create a ComboBox filtered screen in LightSwitch using Visual Studio 2012.
The following is the procedure for creating a ComboBox search screen in LightSwitch 2012.
Step 1
Open the Solution Explorer.
Step 2
In the Solution Explorer, right-click on the data source and choose "Add Table".
Step 3
The table appears. In this way we create two tables (Customer and Item).
The Item Table is shown below.
Step 4
Right-click on the Customer Table and select "Add Query".
The Query Designer appears.
Step 5
In the Query Designer, click on the "Add Parameter" button and add a parameter named "Id" of the "Integer" data type.
Step 6
Now click on the "Add filter" button. Under the Filter condition, next to the where condition from the drop-down list, select "Id". From the next drop-down list select the "Equal" condition. From the next dropdown list select the "parameter" and from the last drop down list, select "Id".
Step 7
Right-click on the Screens and choose "Add Screen".
Step 8
Select the Editable Grid Screen from the Screen Template. Under Screen Information we provide the Screen Name and choose CustomerByItem in the Screen Data and then click OK.
Step 9
The Screen Designer appears.
Step 10
Select "Add Data Item" from the Menu bar of the Screen Designer.
Step 11
The Add Data Item dialog box appear on the screen. Select the Local Property radio button. From the Type option, select the Item (Entity) and name the property "propitem".
Step 12
Again click on the "Add Data Item". Select the Query radio button and choose "Items" and click "OK".
Step 13
Drag "propitem" onto the screen designer above the Data Grid. The screen designer should look like this.
Step 14
After dragging the "propitem" onto the screen designer, go to the property window of the "propitem" and set the choices to "Items".
Step 15
Mapping the "Id" parameter of the "CustomersByItem" to the "propitem" value.
Step 16
Now go to the "Id" property window and in the Parameter Binding TextBox, enter "propitem.Id".
Step 17
Press F5 to run the application.