RadNumericTextBox MaxLength

7 posts, 0 answers
  1. Tarun
    Tarun avatar
    32 posts
    Member since:
    Apr 2011

    Posted 15 Mar 2012 Link to this post

    Hi,

    Is there a way to specify the maximum length (number of digits) for the RadNumericTextBox?

    Thanks
    Tarun Singla
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Mar 2012 Link to this post

    Hi Tarun,

    You need to set MaxLength property of the RadNumericTextBox.
    ASPX:
    <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" MaxLength="10"></telerik:RadNumericTextBox>
    Hope this helps.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tarun
    Tarun avatar
    32 posts
    Member since:
    Apr 2011

    Posted 15 Mar 2012 Link to this post

    Thanks for the prompt response Princy.

    But its my mistake, i did not elaborate my scenario. Here's what i expect:

    I specify the following properties for my RadNumericTextBox:
    NumberFormat-DecimalDigits to some value (say 3),
    NumberFormat-PositivePattern to some value (say " + n"), [please note the blank spaces before and after + symbol)

    In this case, if i specify the max length, then the control will consider the positive pattern also and will truncate my numeric value.

    I wish to specify the maximum number of numeric digits before decimal i.e on the editValue of the control (not the max length for the value of the control).

    Thanks
    Tarun Singla

  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 15 Mar 2012 Link to this post

    Hello Tarun Singla,

    Try to use combination of these settings like MaxLength and DecimalDigits with the MinValue and MaxValue properties.
    For example if you set MinValue="0" and MaxValue="9999". Then you will be able to enter only numbers with length from 1 to 4 digits.

    All the best,
    Vasil
    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.
  6. Tarun
    Tarun avatar
    32 posts
    Member since:
    Apr 2011

    Posted 16 Mar 2012 Link to this post

    Thanks Vasil. That would help me to some extent.

    Regards
    Tarun Singla
  7. Amit
    Amit avatar
    14 posts
    Member since:
    Sep 2012

    Posted 31 Aug 2012 Link to this post

    hello,
    i have the same problem but by using MinValue and MaxValue i can't prompt user . i need somthing which not allowed to enter above my set limit
  8. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 03 Sep 2012 Link to this post

    Hello Amit,

    You can use asp:RangeValidator to check it the value is in some Min/Max range.

    Kind regards,
    Vasil
    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
UI for ASP.NET Ajax is Ready for VS 2017