This is a migrated thread and some comments may be shown as answers.

Positive (unsigned) integers only

4 Answers 294 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 09 Feb 2012, 11:43 AM
Is there a way to make either the RadMaskedNumericInput or RadMaskedTextBox accept only non negative integers?

4 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 14 Feb 2012, 08:10 AM
Hi Chris,

You can apply a minimum value to the RadMaskedNumericInput and RadMaskedCurrencyInput controls. More information on this approach you can find here.

Have a look at the tutorial and tel us know if it helps or if we can further assist you.

Greetings,
Tina Stancheva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Grzesiek
Top achievements
Rank 2
Iron
answered on 19 Mar 2012, 06:26 PM
Hello!

I have the same problem, but solution above doesn't work. I'm getting ""maskedIput" is an undeclared prefix" error.
0
Tina Stancheva
Telerik team
answered on 22 Mar 2012, 12:46 PM
Hi Grzesiek,

I am not sure what is causing the error in your solution. This is why I attached a sample project demonstrating how to limit the MaskedInput control input to only positive numbers.

Let me know if it works for you or if I can further assist you.

Greetings,
Tina Stancheva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Juan
Top achievements
Rank 1
answered on 21 May 2014, 03:11 AM
In case somebody finds this post not so useful to create a masked input control that allows only non-negative integers (at least the suggested solutions didn't work for me either), I have found the following combination of parameter values to work for the RadMaskedNumericInput:

Mask="dddd" AutoFillNumberGroupSeparators="False" IsValidationHintVisible="False" AllowInvalidValues="True"

This allows only integers up to 9999 (if you need other limits, just change the Mask).
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Chris
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Grzesiek
Top achievements
Rank 2
Iron
Juan
Top achievements
Rank 1
Share this question
or