In this article I am going to describes how to Add and Edit Data in basic LightSwitch Application using Visual Studio 2012.
Here we will learn how to add and edit data in a basic LightSwitch Application using Visual Studio 2012.Procedure for creating a basic application.Step 1In the LightSwitch HTML Application, open the Solution Explorer.Step 2Right-click on the data source and choose "Add Table".The table appears.Step 3Right-click on "Screen" and choose "Add Screen".Step 4Select the HTML Browse Screen from the screen template and provide the screen information and click "OK".Step 5The screen designer appears.Go to the properties window, in Behavior set the Screen Type to "Edit". Step 6In order to add the data item to the screen, click on "Add Data Item" in the menu bar.The Add Data Item dialog box appears on the screen. Select the "Local Property" radio button and mark the "IsRequired" checkbox as unchecked and provide a name to the local property and click "OK".Step 7The "Modify" Data Item appears on the screen.Drag and Drop the Modify data item below the Command Bar on your screen.Step 8Choose the Modify data item from the screen designer and go to the property window and set the Label Position : "Hidden" and Font Style : "Large".Step 9Right-click on the command bar in the screen designer and choose "Add Button" to add and edit Employees.The Add Button dialog box appears on the screen. In this select "Add and Edit New" and navigate to "New Screen" and click the "OK" button.The AddEditEmp Screen appears; click the "OK" button. The AddEdit screen designer appears.Step 10Double-click on the "BrowseEmps" Screen.Once again right-click on the command button of the "BrowseEmp" screen and choose "Add Button". But this time choose "Edit Emp" from the Add button Dialog Box.The Screen Designer will look as in the following:Now we can simply add and edit Employees.Step 11Press F5 to run the application.When we click the "Add New" button we get:
Printing in C# Made Easy