Back to Devexpress

TextEditSettings.MaskUseAsDisplayFormat Property

wpf-devexpress-dot-xpf-dot-editors-dot-settings-dot-texteditsettings-5d648302.md

latest4.8 KB
Original Source

TextEditSettings.MaskUseAsDisplayFormat Property

Gets or sets whether display values are still formatted using the mask when the editor is not focused. This is a dependency property.

Namespace : DevExpress.Xpf.Editors.Settings

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public bool MaskUseAsDisplayFormat { get; set; }
vb
Public Property MaskUseAsDisplayFormat As Boolean

Property Value

TypeDescription
Boolean

true if the mask settings are used to format display values when the editor is not focused; false if the settings specified by the BaseEditSettings.DisplayFormat property are used.

|

Remarks

Set the MaskUseAsDisplayFormat property to true to use the editor’s mask settings to format its display text when the editor is not focused. As a result, the editor’s text in edit and display modes will be identical.

Refer to the following help topics for more information: Masked Input, Format Specifiers.

Example

xaml
<dxg:GridControl ItemsSource="{Binding Customers}">
    <dxg:GridControl.View>
        <dxg:TableView />
    </dxg:GridControl.View>
    <dxg:GridColumn FieldName="Name"/>
    <dxg:GridColumn FieldName="City"/>
    <dxg:GridColumn FieldName="Birthday">
        <dxg:GridColumn.EditSettings>
            <dxe:TextEditSettings Mask="d" MaskType="DateTime" MaskUseAsDisplayFormat="True"/>
        </dxg:GridColumn.EditSettings>
    </dxg:GridColumn>
</dxg:GridControl>

The following code snippets (auto-collected from DevExpress Examples) contain references to the MaskUseAsDisplayFormat property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-data-grid-bind-to-pagedasyncsource/CS/PagedAsyncSourceSample/MainWindow.xaml#L20

xml
<dxg:GridColumn.EditSettings>
    <dxe:DateEditSettings Mask="H:mm MM/dd/yy" MaskUseAsDisplayFormat="True"/>
</dxg:GridColumn.EditSettings>

wpf-data-grid-refresh-on-timer/CS/RefreshOnTimer/MainWindow.xaml#L22

xml
<Setter.Value>
    <dxe:TextEditSettings MaskType="Numeric" Mask="f" MaskUseAsDisplayFormat="True" />
</Setter.Value>

wpf-data-grid-bind-to-infiniteasyncsource/CS/InfiniteAsyncSourceSample/MainWindow.xaml#L24

xml
<dxg:GridColumn.EditSettings>
    <dxe:DateEditSettings Mask="H:mm MM/dd/yy" MaskUseAsDisplayFormat="True"/>
</dxg:GridColumn.EditSettings>

wpf-data-grid-use-skip-tokens-to-optimize-paging-EF/CS/MainWindow.xaml#L20

xml
<dxg:GridColumn.EditSettings>
    <dxe:DateEditSettings Mask="MM/dd/yy" MaskUseAsDisplayFormat="True"/>
</dxg:GridColumn.EditSettings>

how-to-bind-to-grpc/CS/InfiniteAsyncSource.GRPC/MainWindow.xaml#L40

xml
<dxg:GridColumn.EditSettings>
  <dxe:DateEditSettings Mask="H:mm MM/dd/yy" MaskUseAsDisplayFormat="True"/>
</dxg:GridColumn.EditSettings>

See Also

TextEditSettings Class

TextEditSettings Members

DevExpress.Xpf.Editors.Settings Namespace