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

RadNumericTextBox MaxLength

6 Answers 593 Views
Input
This is a migrated thread and some comments may be shown as answers.
Tarun
Top achievements
Rank 1
Tarun asked on 15 Mar 2012, 05:35 AM
Hi,

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

Thanks
Tarun Singla

6 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Mar 2012, 05:57 AM
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.
0
Tarun
Top achievements
Rank 1
answered on 15 Mar 2012, 06:04 AM
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

0
Vasil
Telerik team
answered on 15 Mar 2012, 08:28 AM
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.
0
Tarun
Top achievements
Rank 1
answered on 16 Mar 2012, 01:42 PM
Thanks Vasil. That would help me to some extent.

Regards
Tarun Singla
0
Amit
Top achievements
Rank 1
answered on 31 Aug 2012, 11:37 AM
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
0
Vasil
Telerik team
answered on 03 Sep 2012, 07:05 AM
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.
Tags
Input
Asked by
Tarun
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Tarun
Top achievements
Rank 1
Vasil
Telerik team
Amit
Top achievements
Rank 1
Share this question
or