Mask Types
- 3 minutes to read
A mask can consist of several elements. The following element 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.
Character | Meaning |
---|---|
A |
Required alphanumeric character or the space. |
a |
Optional alphanumeric character or the space. |
L |
Required alphabetical character except the space. |
l |
Optional alphabetical character except the space. |
C |
Required any character. |
c |
Optional any character. |
0 |
Required numeric character. |
9 |
Optional numeric character. |
# |
Optional numeric character or the + or - sign, or the space. |
> |
Converts all the characters to the right to uppercase. |
< |
Converts all the characters to the right to lowercase. |
#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.