Back to Devexpress

TextEditSettings.MaskType Property

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

latest6.3 KB
Original Source

TextEditSettings.MaskType Property

Gets or sets the mask type. 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 MaskType MaskType { get; set; }
vb
Public Property MaskType As MaskType

Property Value

TypeDescription
MaskType

One of the MaskType enumeration values.

|

Available values:

Show 16 items

NameDescription
None

The masked input is disabled.

| | DateTime |

The editor accepts date/time values. The mask string must use the DateTime format syntax.

| | DateTimeAdvancingCaret |

The DateTime mask with automatic navigation between mask parts.

If a user completes a part of the value, the caret moves to the next editable part.

| | DateOnly |

The editor accepts date values. The mask string must use the DateOnly format syntax (.NET 6.0+ required).

| | DateOnlyAdvancingCaret |

The DateOnly mask with automatic navigation between mask parts.

If a user completes a part of the value, the caret moves to the next editable part.

| | DateTimeOffset |

The editor accepts date/time values with the timezone offset. The mask string must use the DateTimeOffset format syntax.

| | DateTimeOffsetAdvancingCaret |

The DateTimeOffset mask with automatic navigation between mask parts.

If a user completes a part of the value, the caret moves to the next editable part.

| | TimeOnly |

The editor accepts time values. The mask string must use the TimeOnly format syntax (.NET 6.0+ required).

| | TimeOnlyAdvancingCaret |

The TimeOnly mask with automatic navigation between mask parts.

If a user completes a part of the value, the caret moves to the next editable part.

| | Numeric |

The editor accepts numeric values. The mask string must use the Numeric format syntax.

| | RegEx |

The mask should use the full-functional regular expressions.

| | Regular |

The mask should use the simplified regular expression syntax.

| | Simple |

The mask should use the simplified syntax.

| | TimeSpan |

The editor accepts time interval values. The mask string must use the TimeSpan format syntax.

| | TimeSpanAdvancingCaret |

The TimeSpan mask with automatic navigation between mask parts.

If a user completes a part of the value, the caret moves to the next editable part.

| | Custom |

Applies the mask specified in the CustomMask event.

|

Remarks

To learn more, see Masked Input.

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 MaskType 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-refresh-on-timer/CS/RefreshOnTimer/MainWindow.xaml#L22

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

wpf-spreadsheet-bind-grid-control-to-worksheet-data/CS/WpfSpreadsheet_DataBinding/MainWindow.xaml#L26

xml
<Style x:Key="TextEditSettingsStyle" TargetType="{x:Type dxe:TextEditSettings}">
    <Setter Property="MaskType" Value="Numeric"/>
    <Setter Property="MaskUseAsDisplayFormat" Value="True"/>

wpf-data-grid-getting-started-net-framework/CS/WPFDataGridGettingStartedNETFramework/MainWindow.xaml#L26

xml
<dxg:GridColumn.EditSettings>
    <dxe:TextEditSettings Mask="c" MaskType="Numeric" MaskUseAsDisplayFormat="True"/>
</dxg:GridColumn.EditSettings>

wpf-data-grid-getting-started-dot-net/CS/WPFDataGridGettingStartedDotNET/MainWindow.xaml#L42

xml
<dxg:GridColumn.EditSettings>
    <dxe:TextEditSettings MaskType="Numeric" Mask="c" MaskUseAsDisplayFormat="True"/>
</dxg:GridColumn.EditSettings>

See Also

TextEditSettings Class

TextEditSettings Members

DevExpress.Xpf.Editors.Settings Namespace