This article shows how to add a new record using an Editable Datagrid Screen in a LightSwitch application using Visual Studio 2012.
This article shows how to add a new record using an Editable Datagrid Screen in a LightSwitch application using Visual Studio 2012.I am using the table I created in my previous article (http://www.c-sharpcorner.com/UploadFile/18ddf7/customizing-search-screen-in-lightswitch-2012/),The following is the procedure for adding a new record in the Editable DataGrid Screen.Step 1Open the Table (EmpTable) from the Solution Explorer.Step 2Click on the Screen Button from the Menu bar to add the screen. Step 3Since we are creating an Editable DataGrid Screen, choose the "Editable DataGrid Screen" template. Under Screen Information we provide the Screen Name and select any Screen Data and then click OK.Step 4Once you click the "OK" button, the screen designer appears inside the Visual Studio IDE.Step 5Press F5 to run the application. Step 6Click on the Tasks option in the menu and choose the Editable Emp Tables Grid.Step 7This will open the "Editable Emp Tables Grid" screen as a new Tab. In the same screen you will see a "Save" and "Refresh" button, a "Search Panel" and a button called "Export to Excel". It also consists of "Add", "Edit" and "Delete" buttons.
Add a New Record There are two ways to add a record.Step 8The first way is to click on an empty row. That it will create a new row in the DataGrid.Step 9Enter the record in the particular row and click on the Save button.Step 10The second way is to click on the Add (+) Button provided in the screen as in the following:Step 11The "Add New Emp Table" child window appears. Enter the records in the window and click the "OK" button. You will see that the record has been inserted successfully in the Editable Emp Tables Grid.I will explain "How to Edit and Delete a record from an Editable Emp Tables Grid" in my future article.
Printing in C# Made Easy