BaseEditSettings.DisplayFormat Property

Gets or sets the pattern used to format the editor's display value. This is a dependency property.

Namespace: DevExpress.Xpf.Editors.Settings

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

public string DisplayFormat { get; set; }
Public Property DisplayFormat As String

Property Value

Type Description
String

A String value that is the format pattern.

Property Paths

You can access this nested property as listed below:

Show 15 property paths

Remarks

Use the DisplayFormat property to format the editor's value or add any text. The formatted text is displayed if the editor's value is not being edited (the editor is not focused or the value is read-only).

For example, set the DisplayFormat property to c2 to display currency values. If the editor's value is 99.9, its formatted equivalent is $99.90.

NOTE

An editor's value is formatted using string.Format("{0:DisplayFormat}", BaseEdit.EditValue). The display format should match the value's type (see Example 1); otherwise, the format is ignored (see Example 2).

Example 1

<dxe:ButtonEdit DisplayFormatString="c2" IsReadOnly="True">
    <dxe:ButtonEdit.EditValue>
        <sys:Double>99.9</sys:Double>
    </dxe:ButtonEdit.EditValue>
</dxe:ButtonEdit>

Example 2

<dxe:ButtonEdit DisplayFormatString="c2" IsReadOnly="True" EditValue="99.9" />
NOTE

Refer to the Format Specifiers topic for more information on the available DisplayFormat values.

See Also