Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

#Returns

Type Description
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”

<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”

<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