How to Enter Only Positive Numbers

You can control the values entered in the RadMaskedNumericInput and RadMaskedCurrencyInput controls to allow only positive input.

You can use the MaskedInputExtensions.Minimum attached property to define 0 as the minimum value that can be entered in the RadMaskedNumericInput and RadMaskedCurrencyInput controls. This way you will restrict the user to only entering positive values in the controls.

Example 1: Setting the MaskedInputExtensions.Minimum attached property

<UserControl x:Class="MaskedInputSample.MainPage" 
             xmlns=""&#13;             xmlns:x=""&#13;             xmlns:d=""&#13;             xmlns:maskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
             xmlns:mc=""&#13;             xmlns:telerik=""&#13;             d:DesignHeight="300"
    <telerik:RadMaskedNumericInput maskedInput:MaskedInputExtensions.Minimum="0" />

You can find more information about the MaskedInputExtensions class properties in the MaskedInputExtensions article.

See Also

In this article
Not finding the help you need? Improve this article