Edit this page

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="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&#13;             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&#13;             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"&#13;             xmlns:maskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"&#13;             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"&#13;             d:DesignHeight="300"
             d:DesignWidth="400"
             mc:Ignorable="d">
    <telerik:RadMaskedNumericInput maskedInput:MaskedInputExtensions.Minimum="0" />
</UserControl>

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

See Also

Was this article helpful? Yes No

Give article feedback

Tell us how we can improve this article

Dummy