Setting the Mask

The Telerik MaskedEntry for .NET MAUI exposes a Mask(string) property, which represents a string of characters restricting user input. The Mask property can contain literals and special mask characters depending on the used mask type (numeric, text, or regex).

Mask for the NumericMaskedEntry

You can set one of the Standard Numeric Format Specifiers to the Mask property of the RadNumericMaskedEntry.

Setting the Percent (double) Mask

<telerik:RadNumericMaskedEntry Mask="P" />

Setting the Fixed (decimal) Mask

<telerik:RadNumericMaskedEntry Mask="F" />

Setting the Fixed (decimal) Mask

<telerik:RadNumericMaskedEntry Mask="G" />

Setting the Decimal (decimal) Mask

<telerik:RadNumericMaskedEntry Mask="N" />

Setting the Standard (long) Mask

<telerik:RadNumericMaskedEntry Mask="D" />

Setting the Currency (decimal) Mask

<telerik:RadNumericMaskedEntry Mask="C" />

Mask for the TextMaskedEntry

To allow users to enter only numbers inside the RadTextMaskedEntry, apply the Mask for numeric restriction:

<telerik:RadTextMaskedEntry Mask="(000) 000-000" PromptChar=" "/>

To allow users to enter only literals inside the RadTextMaskedEntry, apply the Mask for letter characters restriction:

<telerik:RadTextMaskedEntry Mask="LLLLL"/>

Mask for RegexMaskedEntry

You can define a input pattern of your choice and set it to the Mask property of the RadRegexMaskedEntry:

<telerik:RadRegexMaskedEntry Mask="^(\+0?1\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$" PlaceholderText="(415) 555-2671"/>

For the Mask Types example, refer to the MaskedEntry/MaskTypes folder of the SDK .NET MAUI Application.

See Also

In this article
Not finding the help you need?