Part 4/11: Rapport with Editable Grid Screen in LightSwitch

Posted by in LightSwitch category on for Beginner level | Points: 250 | Views : 13994 red flag

This is the fourth part of the 11 series LightSwitch tutorial. In this part we will learn about what how to work with the Editable Grid Screen for adding, updating and deleting the records .

Table of Content

  1. Introduction
  2. Aim of the article
  3. Steps to create Editable Grid Screen
  4. Functionalities of the Editable Grid Screen
  5. Add a new record
  6. Edit an existing record
  7. Delete an existing record
  8. Conclusion


Rapid business application development is a need of today’s business and keeping that in focus software stewards wants to build the 3 tire applications at a lightning speed where there will be less code, less time will be spent on designing the UI screens , the BAL layer and DAL layer. By keeping all these into focus, on 26th July, 2011, Microsoft has released their new product – LightSwitch.

It is the simplest way for developers of all skill levels to develop business applications for the desktop as well as for cloud. This is the fourth part of the series of 12 LightSwitch tutorials.In this part we will look into how to work with Editable Grid screen.

You can read the other parts of the LightSwitch tutorial as under

  1. Part 1: Introduction to Light Switch
  2. Part 2: Rapport with New Data Screen
  3. Part 3: Rapport with Search Data Screen
  4. Part 4: Rapport with Editable Grid Screen
  5. Part 5: Rapport with List and Details Screen
  6. Part 6: Rapport with Details Screen
  7. Part 7: Rapport with External Data Source – Database
  8. Part 8: Rapport with External Data Source – WCF RIA Service
  9. Part 9:Using a custom control in LightSwitch
  10. Part 10: Publish LightSwitch Application as Desktop application and host in local system
  11. Part 11: Publish LightSwitch Application as Web application


The article assumes that, we have LightSwitch 2011 installed in our system

Steps to create Editable Grid Screen

From the Screen Template, choose the "Editable Grid Screen". Enter a proper Screen Name and choose tblEmployee from the Screen Data.

Run the application.Initially it will appear as under

In this screen we have the option to add a new record, edit an existing record , delete an existing record as shown in the below figure

Functionalities of the Editable Grid Screen

This screen provides a lot of functionalities which are listed as under

  1. Add a new record
  2. Edit an existing record
  3. Delete an existing record
  4. Search a record
  5. Sorting the records for a particular field in the grid
  6. Navigating among the records using the inbuilt pagination
  7. Export the records to Excel

Out of these various functionalities, we have covered #4 to #7 in the Search Data Screen illustration and henceforth will not be repeated here

Add a new record

Adding a new record through the screen is very simple.Click on the Add Button ('+') and we will be prompted as under

Since validations are already in place, so let us fill the values properly

Click OK button and the record has been added

N.B.~ We can also add record by clicking on the last row of the grid twice.

Edit an existing record

For doing editing, let us first choose the record in the grid and click on the Edit Button Icon.

The Edit pop up appears where we can edit the record. Click OK and the result is as under

N.B.~This can also be achieved by editing in the row and then clicking on the Refresh button follwed by clicking on the Save button.

Delete an existing record

Like Adding and Editing records, deleting a record is also simple.Choose the record from the grid and click the delete icon to delete the record

At this point the record will not be deleted but will be marked for deletion

Then click on the refresh button and click on Save.

The records will be deleted permanently

N.B.~Clicking on Discard button will not perform the deletion for the current transaction and Cancel button cancel the operation all together


So in this part we have seen how to work with the Editable Grid Screen for adding, updating and deleting the records. We have also figure out the other functionalities that this screen is providing us.In the next article we will look into the List and Details Screen.

Thanks for reading the article.Happy lightning with LightSwitch.

Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: Niladri Biswas
Member Level: Platinum
Member Status: Member
Member Since: 10/25/2010 11:04:24 AM
Country: India
Best Regards, Niladri Biswas
Technical Lead at HCL Technologies

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)