Edit this page

MaskedTextInput

The RadMaskedTextInput represents the basic control that can be used to restrict the input of text values.

In order to use the RadMaskedTextInput control in your projects you have to add references to the following assemblies:

  • Telerik.Windows.Controls
  • Telerik.Windows.Controls.Input

You can find more info here.

Here is a simple definition of a RadMaskedTextInput control:

Example 1: Define RadMaskedTextInput in XAML

<telerik:RadMaskedTextInput x:Name="radMaskedTextInput" 
                            Width="200"
                            Margin="20 20 20 10"
                            EmptyContent="Enter digits"
                            InputBehavior="Replace"
                            Mask="a20"
                            SelectionOnFocus="SelectAll"
                            TextMode="PlainText"
                            UpdateValueEvent="LostFocus"
                            Value="Sample Text" />

You can further restrict the user input by setting the FormatString property.

Example 2: Setting the FormatString property

<telerik:RadMaskedTextInput HorizontalAlignment="Center"
                            Value="Adam"
                            FormatString="{}UserName: {0} NickName: {0}"
                            Mask="a4" />

See Also