Positive (unsigned) integers only

5 posts, 0 answers
  1. Chris
    Chris avatar
    1 posts
    Member since:
    Feb 2012

    Posted 09 Feb 2012 Link to this post

    Is there a way to make either the RadMaskedNumericInput or RadMaskedTextBox accept only non negative integers?
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 14 Feb 2012 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Grzesiek
    Grzesiek avatar
    87 posts
    Member since:
    Jun 2007

    Posted 19 Mar 2012 Link to this post

    Hello!

    I have the same problem, but solution above doesn't work. I'm getting ""maskedIput" is an undeclared prefix" error.
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 Mar 2012 Link to this post

    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 >>
  6. Juan
    Juan avatar
    5 posts
    Member since:
    Aug 2013

    Posted 20 May 2014 Link to this post

    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).
Back to Top
UI for WPF is Visual Studio 2017 Ready