RadNumericTextBox w/MaxLength and Step=0.1 fails to increment/decrement

4 posts, 0 answers
  1. Andy F.
    Andy F. avatar
    46 posts
    Member since:
    May 2006

    Posted 10 Mar 2010 Link to this post

    This works:

    <telerik:RadNumericTextBox ShowSpinButtons="true" runat="server" ID="Numeric1" Width="200px" IncrementSettings-Step="0.1" NumberFormat-DecimalDigits="1" Value="0.1">  
     
    This has a problem using the spin buttons (they stop running after one click in each direction):
    <telerik:RadNumericTextBox ShowSpinButtons="true runat="server" ID="Numeric1" Width="200px" IncrementSettings-Step="0.1" NumberFormat-DecimalDigits="1" Value="0.1" MaxLength="3"
    Note the only difference is the MaxLength=3 at the end.  If the Increment Step is 1, then it also works.  It has something to do with the last digit and maxlength, I think.

    This is in 2009.3 (Jan release).  Not sure if it's in 2010.1, since that just arrived.
  2. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 11 Mar 2010 Link to this post

    Hello Andy,

    You should not use the MaxLength property with RadNumericTextBox. If you want to limit the value of the control you can use the MaxValue property.

    Kind regards,
    Pavel
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Andy F.
    Andy F. avatar
    46 posts
    Member since:
    May 2006

    Posted 11 Mar 2010 Link to this post

    Since RadNumericTextBox inherits from RadTextBox and RadTextBox supports MaxLength, it seems odd that RadNumericTextBox wouldn't support it.  My reason for using it is to prevent users from entering a number with too many decimal digits (I know it will round, but I don't want to have to explain that to them).  And it only seems to have a problem with this specific circumstance, where the MaxLength is set, the Step is adjusting the last digit and increment/decrement features are attempted.  Doesn't look like a "don't do this", since it obviously works up to a point; it looks like a test case no one tested.
  4. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 12 Mar 2010 Link to this post

    Hi Andy,

    I understand your point however the MaxLength property is not intended for use with the RadNumericTextBox. It is unintuitive to limit the digits of a numeric value with a property that counts decimal digits/group separators. You can control the length of the decimal part of the entered value with the DecimalDigits property.

    Best wishes,
    Pavel
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top