This is a migrated thread and some comments may be shown as answers.

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

3 Answers 167 Views
Input
This is a migrated thread and some comments may be shown as answers.
Andy F.
Top achievements
Rank 1
Iron
Andy F. asked on 10 Mar 2010, 07:47 PM

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.

3 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 11 Mar 2010, 08:17 AM
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.
0
Andy F.
Top achievements
Rank 1
Iron
answered on 11 Mar 2010, 11:31 AM
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.
0
Pavel
Telerik team
answered on 12 Mar 2010, 08:54 AM
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.
Tags
Input
Asked by
Andy F.
Top achievements
Rank 1
Iron
Answers by
Pavel
Telerik team
Andy F.
Top achievements
Rank 1
Iron
Share this question
or