Skip to main content
A newer version of this page is available. .
All docs
V20.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 blazor date time mask display format

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

    xaf 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.

Next Lesson

Use a Multiline Editor for String Properties