Literal String Delimiter in LightSwitch 2012

This article shows how to use the literal string delimiter in LightSwitch Visual Studio 2012.

It indicates that the enclosed characters should be copied as-is to the output string.

Use the following procedure to create a sample showing how to use the Escape literal string delimiter on a Screen.

Step 1

Open the LightSwitch Application in Visual Studio 2012 and go to the Solution Explorer.

Solution Explorer

Right-click on "Data Sources" and choose "Add Table".

Add Table

The table appears in the Table Designer window. Insert the records in the following table.

Student Table

Step 2

Now once again go to the Solution Explorer, right-click on Screens and choose "Add Screen".

Add Screen

The Add New Screen dialog box appears. Select the "Editable Grid Screen" from the Screen Template, inside screen information, choose "Student" under screen data and provide some name to the Screen and click the "OK" button.

Add New Screen

The Screen Designer appears as shown below

Application designer

Step 3

Press F5 to run the application. Provide the information. 

Output of Editable Grid Screen

Step 4

Now stop debugging the application. From the Table Designer select the "BodyTemperature" record as shown in the figure below.

Select body temperature from table

Then go to the Format Pattern of the Property window in the Table Designer and enter
# 'degree' (hash as well as degree in single codes) in the format pattern as shown below.

Degree format pattern

Or enter
enter # "degree" (hash as well as degree in double codes) in the format pattern as shown below.

Format pattern in double codes

Once again press F5 to run the application. In both the cases we will get the same output.

Output in degrees

Up Next
    Ebook Download
    View all
    View all