Articles → Light Switch 2011 → Creating Computed Columns In Light Switch 2011

Creating Computed Columns In Light Switch 2011






Software Requirement




  1. Visual studio 2010 is installed on your machine.
  2. Visual Studio 2010 service pack 1 is installed on your machine.
  3. Microsoft Visual Studio Light switch 2011 is installed on your machine.

Prerequisite Knowledge




  1. What is lightswitch?
  2. What are screens and entities in lightswitch?
  3. How to create an entity in lightswitch?
  4. How to create a screen in lightswitch?

What Are Computed Columns?





Creation Of Person Entity


Picture showing the Person lightswitch table

Click to Enlarge




Add Computed Column In Person Entity






Picture showing adding the computed property in the table

Click to Enlarge





Picture showing adding the IsEligibleToVote computed column in the table

Click to Enlarge


Add Logic For Computed Column




  1. Select the column by single click on the column (IsEligibleToVote in this case).
  2. On the property window click on the Edit Method link.
  3. Code screen comes.
Picture showing the edit method for writing the code in the computed column

Click to Enlarge



Picture showing the code window for writing the code for the computed column

Click to Enlarge


Creation Of Editable Grid Screen






Picture showing selecting the Editable Grid Screen from the Add Screen window

Click to Enlarge


Create A New Record


Picture showing the popup window for adding the data when user clicks on the + icon

Click to Enlarge



Picture showing a popup window for adding the records

Click to Enlarge




Output


Picture showing the output of the computed columns in lightswitch

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, April 2, 2012

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250