ARTICLE

LightSwitch Desktop Application

Posted by Jaganathan Bantheswaran Articles | Learn .NET February 12, 2011
In this article, we shall see how to create a LightSwitch Desktop application. The LightSwitch applications are introduced for creating a line of business applications, which are more data-centric.
Reader Level:
 


Introduction:

In this article, we shall see how to create a LightSwitch Desktop application. The LightSwitch applications are introduced for creating a line of business applications, which are more data-centric

Creating LightSwitch Project:

 Start the VS 2010, Select the LightSwitch from Installed Templates and select the LightSwitch Application as shown below.

1.gif

Give the name for project as SampleLSWindowsApplication.

Setting the Desktop Application:

            After successful creation of LS project go to the Solution Explorer. Right Click the Solution and select the Properties option.

 

2.gif

 

In the properties window you have to select the Application Type Menu Tab. In the Application Type Menu Tab, there will be three types of LightSwitch Application types. To create the Desktop Application [Windows Application] we have to select the first option i.e. Desktop client, 2-tier deployment.

Adding DataSource to the LS Application:

After creating project, the first screen that appears is the DataSource selection screen.

In that screen, we have to select the Create New Table option to create the new table.

              3.gif

The second option is for creating the application that will be using the data source from previously designed.

Adding Fields to Table:

After creating table, we have to add the fields to the table. The LightSwitch gives the nice GUI to create the fields required. We can set the field type and can set the required field option by selecting the checkbox.

4.gif

Adding Screens to the Application:

Adding screens to the application is pretty cool. Just go to the solution explorer and there you can see the Screen folder like icon. Right click the icon and choose the Add Screen option.

5.gif

We can add the screens from tab tabbed window also. The below image shows the option to add screens from tabbed windows.

6.gif

Selecting Screen Template and Assigning Screen Data:

For designing the screen, there are some screen templates available in the VS 2010. So that we can select the screen template for our application. In this sample application, we have selected List and Details Screen.

7.gif

The table for the screen has been listed in the Screen data combo box. If we have created more than one table then we have to select the appropriate table.

After setting, the Table for the Screen our Light Switch application is ready for execution.

As our LightSwitch is data-centric business applications, the same basic CRUD (Create, Read, Update and Delete) operations will be available as menus.

8.gif

 

In this screen, we are having ADD, EDIT, DELETE and REFRESH buttons. Designing the screen will take some more time. We will see the Screen design for LightSwitch in the next article.

Summary:

In this article, simply we have been leant something basic steps to create a LightSwitch Desktop Application.

Please provide your valuable comments and feedback, which is boost for me [as an author].  

Login to add your contents and source code to this article
post comment
     

Its an awesome article .It carries a lot important information with it. Thanks for sharing it. http://www.dapfor.com/en/net-suite/net-grid/features/performance

Posted by net performance Jul 17, 2012

Thank you very much Jagan. I will try this Regards

Posted by bhuven Jul 20, 2011

Hi Bhuvan, Use this code, if(condition) this.FindControl("GroupName").IsVisible = false;

Posted by Jaganathan Bantheswaran Jul 20, 2011

Hello Jaganathan: I need to hide a group box and its components in Lightswitch when certain conditions are tested - eg if export then (hide/grey out group box)..else and must the code be written in screen. Thank you in advance Bhuven

Posted by bhuven Jul 20, 2011

Thanks Suthish, I will take care of it.

Posted by Jaganathan Bantheswaran Feb 13, 2011
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter