Skip to main content
A newer version of this page is available. .
All docs
V21.1
.NET Framework 4.5.2+

Format a Property Value

  • 2 minutes to read

This lesson explains how to format a business class property and specify its mask settings.

In this lesson, you will customize the display format for the Task.StartDate, Task.DueDate, and Task.PercentCompleted properties in the Model Editor.

Note

Before you proceed, take a moment to review the following lessons:

Step-by-Step Instructions

  1. In the MySolution.Module project, open the Model.DesignedDiffs.xafml file in the Model Editor.
  2. Navigate to the BOModel | DevExpress.Persistent.BaseImpl | Task | OwnMembers node.
  3. For the StartDate and DueDate child nodes, change the values of the following properties:

    xaf ASP.NET Core Blazor date time mask display format

  4. For the PercentCompleted child node, set the DisplayFormat property to {0:N0}%.

    xaf ASP.NET Core Blazor percent integer display format

  5. Run the application. Invoke a detail form for the DemoTask class. The StartDate and DueDate properties are formatted depending on the focus state. When the property editor is focused, the EditMask is applied, and the property value is formatted according to the short date pattern (the d edit mask). When the property editor is not focused, the DisplayFormat is applied, and the property value is formatted according to the long date pattern (the D format specifier).

    Tutorial_UIC_Lesson8_5

The PercentCompleted property value is appended with the ‘%’ sign.

Note

In .NET 5, the libraries used for globalization functionality has been changed. Refer to the following topic for details: Globalization APIs use ICU libraries on Windows.

If a current thread’s culture is set to a culture that includes only the language and not the country (for example, “de” or “en”), the currency symbol renders as an international currency symbol (¤), for example: 100,00 ¤.

Refer to the following topics for details:

Next Lesson

Use a Multiline Editor for String Properties