Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Collapse]Editors and Simple Controls
    Templated ListBox Items
   [Collapse]Simple Editors
    [Expand]Included Components
    [Expand]Editors Structure
    [Collapse]Editors Features
      Text Editing Overview
     [Collapse]Mask Editors Overview
       Mask Type: Numeric
       Mask Type: Date-time
       Mask Type: Extended Regular Expressions
       Mask Type: Simple
       Mask Type: Simplified Regular Expressions
     [Expand]Formatting and Parsing Values
     [Expand]Editor Buttons Overview
     [Expand]Dropdown Editors Overview
      Image Editing Menu
     [Expand]Data Binding Overview
     [Expand]Appearance Customization
     [Expand]Miscellaneous Features
    [Expand]Member Tables
    [Expand]Examples
   [Expand]Lookup Editors
   [Expand]Token Edit Control
   [Expand]Breadcrumb Edit Control
   [Expand]Range Control
   [Expand]Image Slider
    Camera Control
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Mask Type: Simple

This document describes the syntax for creating masks of the Simple mask type. These masks are quite plain and therefore they do not allow you to implement sophisticated data input patterns. They can however be useful when an editor should accept a string that has a fixed format and is of a fixed length (for instance, a phone number, zip code, etc).

For general information on the other masked modes refer to the Mask Editors Overview document.

In this topic:

Expanded Simple Mask Mode

To enable the Simple masked mode set the MaskProperties.MaskType property of the RepositoryItemTextEdit.Mask object to MaskType.Simple. The mask itself should be specified via the MaskProperties.EditMask property.

A mask represents a string which can consist of metacharacters, special and literal characters.

Expanded Metacharacters

Metacharacters are used to represent a range of symbols. An end-user can enter text only in the positions which correspond to metacharacters. When a metacharacter is found at a specific position in the mask an end-user can enter any character from the related range in this position in the edit box. The following table lists the available metacharacters:

Character Meaning
L An L character requires an alphabetic character in this position. For the U.S. this is A-Z, a-z.
l An l character permits only an alphabetic character in this position, but doesn't require it.
A An A character requires an alphanumeric character in this position. For the U.S. this is A-Z, a-z, 0-9.
a An a character permits only an alphanumeric character in this position, but doesn't require it.
C A C character requires an arbitrary character in this position.
c A c character permits an arbitrary character in this position, but doesn't require it.
0 A 0 character requires a numeric character in this position.
9 A 9 character permits only a numeric character in this position, but doesn't require it.
# A # character permits only a numeric character or a plus or minus sign in this position, but doesn't require it.

Expanded Special Characters

The following table lists the available special characters which are used to control the case of the input string and to represent various delimiters and currency symbols.

Character Meaning
> If a > character appears in the mask, all the characters that follow it are converted to uppercase until the end of the mask or until a < character is encountered.
< If a < character appears in the mask, all the characters that follow it are converted to lowercase until the end of the mask or until a > character is encountered.
<> If these two characters appear together in a mask, no case checking is performed and the data is formatted with the case used by the end-user during data entry.
/ A / character is used to separate the months, days, and years in dates. If the character that separates the months, days, and years is different in the regional settings of the system that the application runs on that character will be used instead.
: A : character is used to separate the hours, minutes, and seconds in time values. If the character that separates the hours, minutes, and seconds is different in the regional settings of the system that the application runs on that character will be used instead.
$ A $ character is used to designate currency values. If the character that designates the currency values is different in the regional settings of the system that the application runs on that character is used instead.

Expanded Literal Characters

A character that is neither a metacharacter nor a special character is called a literal. Literals are inserted automatically as is into the edit box in their positions defined by the mask. An end-user has no need to enter literal characters. The cursor skips over them during editing.

The metacharacters and special characters can also appear as literal characters if they are preceded by a backslash (\).

Expanded Examples

1. A mask for entering a telephone number: (000)000-00-00.

Each '0' metacharacter in this mask requires a numeric character in the corresponding position. No characters can be omitted. The '-', '(' and ')'characters in the mask are literals.

The following are images of an editor that uses this mask:

(a value is not entered)

(a value is entered)

2. A mask for entering a telephone number with an optional area code: (999)000-00-00

Here the '9' metacharacter allows end-users to omit the area code part of a phone number.

(a valid phone number without a code part)

3. A mask for entering an alpha-numeric sequence:\A>LL-00

Here '\A' stands for the literal character 'A'. Since 'A' is used as a metacharacter the backslash must be used to make 'A' appear as a literal. The '>' command specifies that the following text should be in uppercase. The 'LL' substring indicates that two alphabetical characters should be inserted in this position. The '00' substring is a placeholder for two digits.

(a value is not entered)

(a value is entered)

Expanded See Also

How would you rate this topic?​​​​​​​