Edit this page

MaskedCurrencyInput

The RadMaskedCurrencyInput represents the basic control that can be used to restrict the input of currency values.

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

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

You can find more info here.

Here is a simple definition of a RadMaskedCurrencyInput control:

Example 1: Define RadMaskedCurrencyInput in XAML

<telerik:RadMaskedCurrencyInput Width="200"
                                Margin="20 20 20 10"
                                Culture="en-US"
                                EmptyContent="Enter digits"
                                InputBehavior="Replace"
                                Mask="#9.2"
                                SelectionOnFocus="SelectAll"
                                TextMode="PlainText"
                                UpdateValueEvent="LostFocus"
                                Value="12345.67" />

You can further customize the RadMaskedCurrencyInput control's behavior by setting the IsCurrencySymbolVisible property to False thus hiding the culture specific currency symbol. By default this property is set to True.

You can further restrict the user input by setting the FormatString property.It uses Standard Numeric Format Strings and Custom Numeric Format Strings to further format the Text property.

Example 2: Setting the FormatString property

<telerik:RadMaskedCurrencyInput HorizontalAlignment="Center"
                                EmptyContent="Enter currency"
                                Culture="en-US"
                                FormatString="{}The currency value is {0:c2}, the numeric value is {0:n2}"
                                UpdateValueEvent="LostFocus"
                                SpinMode="PositionAndValue" 
                                Value="123456"/>

See Also