Skip to main content

MaskAttribute.IncludeLiterals Property

Gets or sets a value that specifies which constantly displayed mask characters (literals) are included in an editor’s value.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.2.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public MaskIncludeLiteralsMode IncludeLiterals { get; set; }

Property Value

Type Description
MaskIncludeLiteralsMode

One of the MaskIncludeLiteralsMode enumeration values.

Available values:

Name Description
All

All literals are included in an editor’s value.

None

Literals are not included in an editor’s value.

DecimalSymbol

Only decimal symbol literals are included in an editor’s value.

Remarks

A mask expression specified via the MaskAttribute.Mask property can consist of several parts. See the Mask Types topic to learn more. Use the IncludeLiterals property to control which kinds of literal symbols composing a mask should be included into an editor’s value.

If the IncludeLiterals property is set to MaskIncludeLiteralsMode.All (the default behavior), the edit value will store mask literal characters along with the data entered by an end-user. Placeholder symbols defined via the MaskAttribute.PromptChar property are not included in an editor’s value for unfilled placeholders.

If the IncludeLiterals property is set to MaskIncludeLiteralsMode.None, only user input characters are stored in the edit value.

Set the IncludeLiterals property to MaskIncludeLiteralsMode.DecimalSymbol, to include culture dependant decimal symbols in an editor’s value.

Assume that the edit mask is “$<0..9999g>.99”, and an end-user enters the “2” symbol into the editor five times, as shown below:

MaskSettings_IncludeLiterals.png

The following table illustrates how setting the IncludeLiterals property affects the value of an editor.

The IncludeLiterals property’s value The editor’s value
All $2,222.2
DecimalSymbol 2222.2
None 22222
See Also