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

MaskProperties.SaveLiteral Property

For the Simple and Regular mask types this property gets or sets whether constantly displayed mask characters (literals) are included in an editor’s value.

Namespace: DevExpress.XtraEditors.Mask

Assembly: DevExpress.XtraEditors.v18.2.dll

Declaration

public virtual bool SaveLiteral { get; set; }

Property Value

Type Default Description
Boolean **true**

true if the constantly displayed mask characters are included in an editor’s value; otherwise, false.

Remarks

This setting is in effect for the MaskType.Regular and MaskType.Simple mask types. For the MaskType.RegEx mask type the constantly displayed characters are always included in the editor’s value.

For the Regular and Simple mask types a mask expression consists of control symbols (which define the type of character that should appear in a corresponding position or otherwise control user input) and literals. If the SaveLiteral property is true, the edit value will store literal characters along with characters representing placeholders and data an end-user enters. If the property is false, only placeholders and user input characters are stored in the edit value.

Assume the edit mask is ‘(999)000-00-00’ (the mask type is Simple) and the user completes only a portion of the mask text as shown below:

Mask_SaveLiteralExample

If the SaveLiteral property is true, the edit value will contain ‘(123)990-__-__’ . Here the ‘(‘ and ‘-‘ are literals and ‘_’ is a character representing a placeholder. If the SaveLiteral property is false, the edit value will store ‘123990____’.

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