Prologue:My previous article described how to get the selected item from ListView and how to programmatically delete the selected item permanently in LightSwitch Beta 2. Today we shall see how to display a screen with records retrieved from a database based on the parameter passed to the screen.Need of passing parameter to Screen:When we need to display a particular set of records to the user at the start-up of a screen then we have to use a parameterized query in the screen.Let us consider, we have two screens in which one is used to display the single value [summary property] on selecting that it will display the other screen with the details of the selected single value.To demonstrate this, we shall create a demo LightSwitch Desktop application.Preparing the Solution:Fire up the VS 2010; create a LightSwitch Desktop application with the name "PassingParameterToScreenInLSBeta2" as shown in the figure. Follow the No: # to create the Desktop LightSwitch application.The Entity Designer: Let us create a Table. This is a new screen of Beta 2 which is not available in Beta 1. Select the rounded option to create a new table.After clicking on the "Create new table" option, the Entity Designer will be displayed to create the Entity required. In this demo application we create the table called "Person". To change the Table name simply click on the Header of the Entity Designer and give the new name. Screens to application:For the demo application we need to create three screens.
C# Corner. All contents are copyright of their authors.