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

RadNumericTextBox Increment Validation

3 Answers 133 Views
Input
This is a migrated thread and some comments may be shown as answers.
Landon
Top achievements
Rank 2
Landon asked on 02 Nov 2010, 10:08 PM
Hello,

I am using multiple RadNumericTextBoxes on a page would like to Validate that the user can only input in half increments.

For example: 0.5, 1.0, 1.5, 2.0, 2.5... ect.

I have tried using the <IncrementSettings Step="0.5" /> property on the RadNumericTextBox but have only achieved a Scroll/Arrow key Increment. This also did not stop the user from initially entering a foreign value (ex. 6.2).
Is there a property on RadNumericTextBox which will achieve this?

Best Regards,

Landon

3 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 03 Nov 2010, 03:48 PM
Hi Landon,

You can use RegularExpressionValidator with your custom expression.

<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Type="Number" NumberFormat-DecimalDigits="1">
</telerik:RadNumericTextBox>
<asp:RegularExpressionValidator ID="myValidator" runat="server" Display="Dynamic"
    ErrorMessage="Please enter valid number." ValidationExpression="^\d+(\.[5])?$"
    ControlToValidate="RadNumericTextBox1">
</asp:RegularExpressionValidator>


Best wishes,
Vasil
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
Jugoslav
Top achievements
Rank 1
answered on 28 Mar 2014, 11:37 AM
Could we use the same control or any other control for half increments but in a little different manner which is

1, 1 & 1/2, 2, 2 & 1/2, 3 etc. etc.

or

1, 1 & half, 2, 2 & half, 3, etc etc.

Thank you
0
Vasil
Telerik team
answered on 28 Mar 2014, 01:37 PM
Hello Jugoslav,

You can use RadMaskedTextBox with any mask. In this case the " & 1/2" or "& half" will be defined as enum string mask part in your control. However the IncrementSettings will not work in this case.

Regards,
Vasil
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
Input
Asked by
Landon
Top achievements
Rank 2
Answers by
Vasil
Telerik team
Jugoslav
Top achievements
Rank 1
Share this question
or