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.
Before you proceed, take a moment to review the following lessons:
- In the MySolution.Module project, open the Model.DesignedDiffs.xafml file in the Model Editor.
- Navigate to the BOModel | DevExpress.Persistent.BaseImpl | Task | OwnMembers node.
For the StartDate and DueDate child nodes, change the values of the following properties:
For the PercentCompleted child node, set the DisplayFormat property to
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
dedit 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
The PercentCompleted property value is appended with the ‘%’ sign.
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:
Refer to the following topics for details: