Back to Devexpress

NumericMaskOptions.ValueAfterDelete Attached Property

wpf-devexpress-dot-xpf-dot-editors-dot-numericmaskoptions.md

latest2.8 KB
Original Source

NumericMaskOptions.ValueAfterDelete Attached Property

Specifies whether the editor sets the 0 (zero) or null value after the last digit is removed. This is an attached property.

Namespace : DevExpress.Xpf.Editors

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

NuGet Package : DevExpress.Wpf.Core

Declaration

See GetValueAfterDelete(DependencyObject) and SetValueAfterDelete(DependencyObject, ValueAfterDeleteMode).

Returns

TypeDescription
ValueAfterDeleteMode

A value the editor sets after the last digit is removed.

|

Remarks

The ValueAfterDelete property is in effect only when the editor can accept null as its EditValue (see the AllowNullInput property).

ValueAfterDelete = “ZeroThenNull”

xaml
<dxe:TextEdit Mask="d" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="10" 
              AllowNullInput="True" dxe:NumericMaskOptions.ValueAfterDelete="ZeroThenNull"/>

When a user removes the last digit, the editor value becomes 0 (zero). If a user presses the Backspace or Delete key to remove this zero, the editor value becomes null.

If a user has cleared an entire value (the user presses Ctrl+Del, or selects and removes the entire text), the editor value becomes null immediately.

ValueAfterDelete = “Null”

xaml
<dxe:TextEdit Mask="d" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="10" 
              AllowNullInput="True" dxe:NumericMaskOptions.ValueAfterDelete="Null"/>

When a user removes the last digit, the editor value becomes null.

Note

If the editor mask has only hash metacharacters (for example, “####”), it appears empty as soon as a user removes the last digit. However, if the ValueAfterDelete value is ZeroThenNull, the underlying editor’s EditValue is still 0. A user must press Ctrl+Del to completely clear the editor and set its EditValue to null.

See Also

NumericMaskOptions Class

NumericMaskOptions Members

DevExpress.Xpf.Editors Namespace