I've seen code around that will limit RadMaskedNumericInput to be 0 or greater, but I need to exclude 0.
1 Answer, 1 is accepted
0
Stenly
Telerik team
answered on 10 Sep 2025, 10:22 AM
Hello Zack,
May I ask if it would be possible to set the MaskedInputExtensions.Minimum attached property to 1? This way, the RadMaskedNumericInput element will accept values equal to or higher than 1.
For this suggestion, you could set the Range attribute as follows:
publicclassMainViewModel : ViewModelBase
{
privatedouble? value;
//Value property is bound to the Value property of the RadMaskedNumericInput.
[Range(0.000001, double.MaxValue, ErrorMessage = "Value must be greater than 0.")]
publicdouble? Value
{
get { returnthis.value; }
set
{
this.value = value;
this.OnPropertyChanged(nameof(this.Value));
}
}
}
An alternative approach would be to use the IDataErrorInfo interface to validate the Value property. I attached a sample project showcasing this approach.