Rad Numeric Textbox

3 posts, 0 answers
  1. Ana
    Ana avatar
    12 posts
    Member since:
    Apr 2014

    Posted 01 Jul 2014 Link to this post


    I set maxlength of Numeric textbox to 16 as I want to limit the number of characters to be entered. And maxvalue as 9999999999999999  (16 characters).
    But, when I entered 16 characters into it, it is reverting the number back to 9999999999999999. How can I save 16 entered numbers as is and restrict to revert back?

    Thank you.
  2. Ana
    Ana avatar
    12 posts
    Member since:
    Apr 2014

    Posted 01 Jul 2014 Link to this post

    Below is my aspx code.

    ​<telerik:RadNumericTextBox ID="CustomerId" Runat="server" MaxLength="16" MaxValue="9999999999999999" MinValue="0" Type="Number">
    <numberformat decimaldigits="0" groupseparator="" /></telerik:RadNumericTextBox>

    The text entered is 1234567891234567.   It is saving as 1.23456789123457E+15 
  3. Viktor Tachev
    Viktor Tachev avatar
    2501 posts

    Posted 04 Jul 2014 Link to this post

    Hello Ana,

    Please note that the RadNumericTextBox supports values that are between -2^46 and +2^46. Setting the MinValue and MaxValue properties outside that range could result in unexpected behavior from the RadNumericTextBox. If you would like additional information on the control, you would find this article interesting.

    This said, if you would like to have an input control that allows the user to enter a number that would be less or equal to 16 digits, try using the RadMaskedTextBox. Check the sample markup below and see if it works for you:

    <telerik:RadMaskedTextBox runat="server" ID="RadMaskedTextBox1" Mask="################"></telerik:RadMaskedTextBox>

    Viktor Tachev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top