Formatting Date in LightSwitch Visual Studio 2012

Format Date in LightSwitch Visual Studio

By using the Format Pattern property, we can specify how date types appear in an application that is designed and developed in LightSwitch Visual Studio 2012. For example suppose we want to display a Date that includes the day of the week (4/30/2013 as Tuesday, April 30, 2013).

Procedure for formatting a Date in VisualStudio LightSwitch 2012

Step 1

Open the Solution Explorer.

Image 1


Step 2

In the Solution Explorer, double-click or right-click on the table to open it.

Image 2


Step 3

The table opens in Data Designer.

Image 3

employee table.jpg

Step 4

In the table, choose the field of type Date or DateTime that you want to format.

Image 4

employee table1.jpg

Step 5

In the Menu Bar, click on View and after that choose the Property Window

Image 5


Step 6

Open the Property Window

Image 6


Step 7

In the Property Window, in the formatting section choose the format pattern property and then specify a valid format string. For more information about format strings, see:

Image 7


Step 8

Again, open the Solution Explorer.

Image 8


Step 9

In the Solution Explorer, open the screen ("CreateNewEmployeeTab").

Image 9


Step 10

The screen opens in the Screen Designer.

Image 10


Step 11

In the Screen Designer select the item that represents the date that we want to format. 

Image 11


Step 12

In the format list you can choose either label or TextBox. Here I have taken TextBox.

Image 12

choose prod date.jpg

As we start debugging it we enter the value:

enter value.jpg

When we click on "Save" button we get:

new output.jpg

Up Next
    Ebook Download
    View all
    View all