MaxLength for RadNumericUpDown

7 posts, 0 answers
  1. Lauren Nickerson
    Lauren Nickerson avatar
    52 posts
    Member since:
    Jul 2009

    Posted 13 Jul 2009 Link to this post

    Hello, is it possible to set a MaxLength to the RadNumericUpDown so the user can't input more than the allowed number? (Exactly like the WPF TextBox), I tried the code below but it didn't work since ContentText is readonly:



    void textBoxWidth_KeyDown(object sender, KeyEventArgs e)




        if (textBoxWidth.ContentText.Length > 1)



            textBoxWidth.ContentText = 9;

            textBoxWidth.Value = 9;




  2. Hristo Borisov
    Hristo Borisov avatar
    298 posts

    Posted 16 Jul 2009 Link to this post

    Hello Lauren Nickerson,

    Why would you need this functionality? If you have specified the number of digits of your input for example to 2, which is the default behavior, your value won't be rounded to this precision. Would you explain in more details the reason you want to constrain the text, so we can evaluate your scenario for a possible feature. Thank you for contacting us and we look forward to receiving your feedback.

    All the best,
    Hristo Borisov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Sav
    Sav avatar
    2 posts
    Member since:
    Dec 2011

    Posted 08 Dec 2011 Link to this post


    It would be goog, if lenght could be set and Its not about rounding. Firstly, it looks good when user cannot exceed lets say four digit number, because width is set and longer text will start to hide. Ther other thing is, that you may accidentally enter one extra digit beyond digit number of maximum value. The result is that if wanted to enter for example 333, and by mishap entered 3333, the value automaticaly jumps to maximum which is somthing like 999 or whatever else. User might miss that change, especially when lost focus is due to 'Submit' button click...      

    So I would add that funcionality. 

  4. Boyan
    Boyan avatar
    758 posts

    Posted 12 Dec 2011 Link to this post

    Hello Sav,

    Thank you for your feedback. You are right that sometimes this is a little bit confusing and not very user friendly. I have logged your request in our PITS system with ID8833. You can follow its progress and vote for this feature.

    As a workaround you can use RadMaskedTextBox if you don't need the up and down arrows, there you can use a mask with fixed number of digits.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. Christian
    Christian avatar
    52 posts
    Member since:
    Apr 2011

    Posted 07 Aug 2013 Link to this post

    The Issue has been aborted. Can you please tell me why? I wanted to vote for it...
  6. Konstantina
    Konstantina avatar
    2332 posts

    Posted 08 Aug 2013 Link to this post

    Hello Christian,

    The item is very old and it didn't have enough demand, so we decided to delete it. However, this still can be achieved by editing the style of the NumericUpDown control. Inside is the TextBox, which displays the number and you could set its MaxLength property to limit the input.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  7. Jayesh
    Jayesh avatar
    1 posts
    Member since:
    Aug 2018

    Posted 31 Aug 2018 Link to this post

      <Style TargetType="{x:Type TextBox}">
          <Setter Property="MaxLength" Value="6"/>
Back to Top