O'Reilly logo

Microsoft Visual Studio LightSwitch Business Application Development by Jayaram Krishnaswamy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing and testing screen-related code

As mentioned previously, the code can be written targeting Entity, Query, Screen, and so on. Here, we will look at a couple of examples of code targeting the screens.

Entering default values using code with screens

Just as in the previous section, the code can be written targeting the screen to provide default values when no values are provided during data entry. We will use the same project as in the previous section:

  1. Bring up the Screen designer by double clicking on the EditableSupplierGrid screen in the Screen node of the Solution Explorer.
  2. Highlight Rows Layout | Editable Suppliers Grid and click on Write Code to reveal the drop-down menu, as shown in the next screenshot:
  3. Click on the EditableSuppliersGrid_Saving ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required