How to Show Model Windows and Group Box on Screen in LightSwitch 2012

In this article you will learn how to load data in the form of model windows and group box on screen in LightSwitch 2012.

Getting Started

Create the project using the following:

  1. Open Visual Studio 2012.
  2. Go to "File" => "New" => "Project..."
  3. Select "LightSwitch" in installed templates.
  4. Select "LightSwitch Application (Visual C#)".
  5. Enter the Name and choose the location.
  6. Click "OK".

Now click on "Attach to external Data Source" and select ODataService and click the "Next" button.

This is my customer data screen.

img1.jpg

Image 1.

Now add a search data screen and select customer data from screen data drop down and click the "Ok" button.

img2.jpg

Image 2.

Screen designer looks like this:

img3.jpg

Image 3.

So our target is, we must show contact details in model windows or group box, so let's delete Address, City, Region, Postal Code and Country Phone from the Command Bar and it should be like this:

img4.jpg

Image 4.

Now let's add a new group on click of Add.

img5.jpg

Image 5.

And provide a group name and display name (optional).

img6.jpg

Image 6.

Now click on the "Add" button below the group and add all contact columns one by one.

img7.jpg

Image 7.

Now select the group name and check the property windows and select "Model Windows" from "Control Type".

img8.jpg

Image 8.

Now hit F5 to see the output.

img9.jpg

Image 9

Since you can see that the Contact Details button has been visible in every row, now click on a button to see the details in the model windows.

img10.jpg

Image 10.

If you want to see contact details in the group box then select "Group Box".

img11.jpg

Image 11.

Again hit F5.

img12.jpg

Image 12.

Up Next
    Ebook Download
    View all
    Learn
    View all