Communication Across Screens in Visual Studio LightSWitch 2011


As you probably know, Visual Studio LightSwitch is a tool provided by Microsoft to build business applications. In this article you will see how to communicate screens in a LightSwitch application.

You can say a screen is a template in which you display data. There are five types of data screens in the LightSwitch Application i.e. New Data Screen, Search Data Screen, Details Screen, Editable Grid Screen, List and Details Screen. If you want to communicate across screens in a LightSwitch application then you can do that.

When we establish a relationship among screens then the process is called communication among screens.

Step 1 : First of all open Visual Studio LightSwitch->Click on new project->Select LightSwitch->Select LightSwitch application->Write name (CommunicatioScreens)->Ok.

image1.png

Step 2 : Click on create new table.

image2.png

Step 3 : Create tables such as customer and order.

image3.png

image4.png

Step 4 : Now we will establish a relationship between these tables. To establish the relationship then click on relationship.

image5.png

Step 5 : Now we establish a one to many relationship from the customer to the order as in the following image.

image6.png

Step 6 : Now we will add a screen. Right click on screens->Add screen

image7.png

Step 7 : Select new data screen->Select screen data (customer)->Ok.

In the same manner we we will add a new data screen for the order table.

image8.png

Step 8 : In the same manner we will add a list and details screen for customer and order tables.

ninth.png

Step 9 : Click add data item->Select query->Select customer->Write name (CustomerChoice)->Ok.

image9.png

Step 10 : Go to the properties of the customer in CreateNewOrder screen->Select choice (CustomerChoice).

image10.png

Step 11 : Run the application (Press F5). Click on create new customer for adding a customer then save.

image11.png

Step 12 : Click on create new order for adding an order.

image12.png

Step 13 : If you want to see the details of a customer or order then you can. To do that you will click on customer list details and order list details. In this section you can change the customer for order like in the following image.

image13.png

Conclusion

So in this article you saw how to communicate screens in a LightSwitch application.

Some Helpful Resources


Similar Articles