Mask Property (XamMaskedEditor)

Returns or sets the mask associated with the masked edit control.
Public Property Mask As String
public string Mask {get; set;}

When a mask is defined, placeholders are defined by the PromptChar property. When inputting data, the user can only replace a placeholder with a character that is of the same type as the one specified in the mask. If the user enters an invalid character, the control rejects the character and generates the InvalidChar event. The control can distinguish between numeric and alphabetic characters for validation, as well as validate for valid content for certain types like, date or time or numeric types such as the correct month or time of day etc...

For a complete list of the various mask tokens as well as examples please refer to Masks topic.

Note: When specifying the mask from within XAML and using one of the special tokens that are enclosed within {}, you must preceed the mask with {} - e.g. {}{date}.

This example shows how to use Extensible Application Markup Language (XAML) to define a XamMaskedEditor and initialize its Mask. Note: When you use one of the custom tokens that are placed within {} from within XAML, you must prefix the mask with an empty {}.
<igEditors:XamMaskedEditor Name="mskDate" Mask="{}{date}" />

<igEditors:XamMaskedEditor Name="mskDate2" Mask="mm/dd/yyyy" />

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also