Skip to main content
A newer version of this page is available. .

MaskProperties.IgnoreMaskBlank Property

For the Simple, Regular and RegEx mask types this property gets or sets whether an editor can lose focus when a value hasn’t been entered.

Namespace: DevExpress.XtraEditors.Mask

Assembly: DevExpress.XtraEditors.v18.2.dll

Declaration

public virtual bool IgnoreMaskBlank { get; set; }

Property Value

Type Default Description
Boolean **true**

true if an editor can lose focus when a value has not been entered; otherwise, false.

Remarks

This property is in effect for the MaskType.Simple, MaskType.Regular and MaskType.RegEx mask types. For other mask types this property is ignored since the masked editor doesn’t support placeholders in other modes.

If the IgnoreMaskBlank property is set to true an empty editor can lose focus. If the editor’s value is only partially completed (there are still empty placeholders) focus cannot be moved from the editor until an end-user enters the entire value or deletes the value by clearing the edit box.

If the IgnoreMaskBlank property is set to false focus cannot be moved from the editor until its value has been completely filled.

An error in the editor is indicated by an error icon:

CD_Mask_IgnoreMaskBlank_false

To provide an appropriate response when an invalid value has been entered the BaseEdit.InvalidValue event can be handled.

Note: for the RegEx mask type setting this property to true is equivalent to enclosing the current mask expression within braces and appending the question metacharacter. For instance, the “\d\d” mask with the IgnoreMaskBlank property set to true is equivalent to the “(\d\d)?” mask with the IgnoreMaskBlank property set to false.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the IgnoreMaskBlank 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.

See Also