This article describes how to use a section separator(;) in LightSwitch Visual Studio 2012.It is used to define sections along with separate format strings for positive, negative, and zero numbers.The semicolon (;) is a conditional format specifier that we can apply to various format patterns. In order to produce this behavior, a custom format string consists of up to three sections separated by semicolons. These sections are:
The following is the procedure for creating a sample showing how to use Section Separator delimiters on a Screen.Step 1Open the LightSwitch Application in Visual Studio 2012 and go to the Solution Explorer.Right-click on the Data Source and choose "Add Table".The table appears in the table designer window. Insert the records in the following table.Step 2Now 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. Step 4Now stop debugging the application. From the Table Designer select the "Fees" record as shown in the figure below.Then go to the Format Pattern of the Property window in the table designer and enter "#0.0#;(#0.0#)" in the format pattern as shown below.Press F5 to run the application. Provide a positive value in the "Fees" column.Click on the "Save" button; we will get the following output:Step 5Now stop debugging the application and then go to the Format Pattern of the Property window in the table designer and enter "#0.0#;(#0.0#)" in the format pattern as shown below.Once again press F5 to run the application. Provide a zero value in the "Fees" column.Click on the "Save" button; we will get the following output.Step 6Now stop debugging the application and go to the Format Pattern of Property window in the table designer and enter "#0.0#;(#0.0#)" in the format pattern as shown below.Once again press F5 to run the application. Provide a negative value in the Fees column.Click on the "Save" button; we will get the following output.Step 7You can also enter the "#0.0#;(#0.0#);-\0-" pattern in the format pattern property window.Again press F5 to run the application. Provide a zero value in the "Fees" column.Click on the "Save" button; we will get the following output.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: