How do i validate "valid" decimal value with Radmaskedtextbox

2 posts, 0 answers
  1. Ramesh
    Ramesh avatar
    3 posts
    Member since:
    Mar 2012

    Posted 23 May 2012 Link to this post


    Hi Team,

    We are using masked textbox in few important places in our system for different type of input validation.

    Now, i am dead stuck with how to i validate the "Valid" Decimal value with masked text box.

    "#" or "9" format must need the that many number of digits.

    e.g. valid decimal numbers are:
    111.124
    11.12455
    11111.12455

    Making mask "######.######" like that, must require user to type in leading "0(zero)", which is real pain.

    If you could be of any help solving this mystry will be great help.

    Thanks,
    J. Ramesh
  2. Martin
    Admin
    Martin avatar
    833 posts

    Posted 24 May 2012 Link to this post

    Hello Ramesh,

    Note that by design RadMaskedTextBox is supposed to be used when user input should be limited to specific characters only. The control does not fit very well in numeric input validation scenarios.  Instead, I would suggest that you utilize the RadNumericTextBox control which is especially designed to work with numeric values. It provides properties like MinValue(MaxValue), DecimalDigits and NumberFormat which you can successfully use to achieve your goal.

    Regards,
    Martin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top