Mask Types

  • 3 minutes to read

A mask can consist of several parts. The following part types are available:

Prompts

A prompt specifier is a single symbol. When a user edits a form field, the edit box displays prompt specifiers with a placeholder character defined by the MaskSettings.PromptChar property.

A, a - Alphanumeric

L, l - Alphabetic

C, c - Any char

Note

Specifiers in upper case require users to fill a prompt. If such a prompt is left empty - the mask will not be valid.

> - Converts all symbols to the right to upper case

< - Converts all symbols to the right to lower case

~ - Cancels the effect of the “<” or “>” symbol

# - Optional digit or signum symbol

9 - Optional digit

0 - Required digit

Culture-dependent separators

Standard culture-dependent separators are allowed, such as $ : / , and .

Ranges

The range mask type allows you to define a range of allowable integer values. To do this, specify the minimum and maximum limits. You can define a range’s default value, allow zero-filling, and control whether a culture-dependent thousands separator is automatically displayed. This mask type also enables you to display mask hints.

Note

You cannot use the # symbol in the range mask type.

<0..100>

<0..50..100> - With default value

<-100..100> - Negative values are allowed

<00..100>, <01..31> - Zero-filling is enabled

<0..9999g> - The thousands separator is added automatically (the current culture specifies the separator character)

Enumerations

Using this mask type, you can define a collection of allowable string values and specify the default value, if required. This mask type allows you to display mask hints.

<A|B|C>

<A|*B|C> - With default value

Use the MaskSettings.AllowEscapingInEnums property to control whether you can use a backslash symbol () and quotes (single ‘ ‘ and double “ “) as escape characters in enumeration masks to allow the use of special characters inside a mask string.

Date-time specifiers

Standard and custom date-time specifiers are allowed, such as ‘d’, ‘dd MM yyyy’ and so on.

Literals

You can use literal symbols within mask expressions to group or separate different mask parts (parentheses in phone numbers or dashes in serial numbers). The following are considered literals:

  • Symbols not specified above

  • A symbol preceded by a backslash ‘'

  • A group of symbols wrapped with quotation marks (“$ : / , .”) or apostrophes (‘$ : / , .’)

Use the MaskSettings.IncludeLiterals property to control which kinds of literal symbols should be included in an editor value.

See Also