This article describes how to use Format Patterns for the Integer datatype in LightSwitch Visual Studio 2012.
This article describes how to use Format Patterns for the Integer datatype in LightSwitch Visual Studio 2012.The Format Pattern for Integers consists of the following three types of patterns:
The following is the procedure to use an Integer Format Pattern on a Screen.Step 1Open the LightSwitch Application in Visual Studio 2012 and go to the Solution Explorer.Right-click on "Data Sources" and choose "Add Table".The table appears in the table designer window. Insert the records into the following table.In the preceding table I added a record named "Fees" and I used "Integer" for the datatype.Step 2Select the "Fees" record from the table and go to the Property window and provide "+#" under the Format Pattern TextBox.Now once again go to the Solution Explorer, right-click on Screens and choose "Add Screen".The Add New Screen dialog box appears. Select the "Editable Grid Screen" from the Screen Template, inside the screen information, choose "Student" under screen data and provide some name to the Screen and click the "OK" button.The Screen Designer appears as shown below.Step 3Press F5 to run the application. Provide the information. The result is that the number will be displayed with a positive symbol(+).Step 4Stop debugging the application.Once again go to the Format Pattern of Property window in the table designer. This time enter "-#" in the format pattern of the Property window. Once again press F5 to run the application. This time the result is that the number will be displayed with a negative symbol(-).Step 5Stop debugging the application.Once again go to the Format Pattern of Property window in the table designer. This time enter "0" in the format pattern of the Property window.Once again press F5 run the application. This time we will get the same output, in other words there is no change in the output.Step 6Stop debugging the application.Once again go to the Format Pattern of Property window in the table designer. This time enter "No Change" in the format pattern of the Property window. Once again press F5 to run the application. This time we will get the following output.NOTE: The text "No change" can work with or without quotes since there are no special formatting patterns for Integers. The quote can even be single quotes.
Printing in C# Made Easy