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

[Solved] Help with RadNumericTextBox

2 Answers 233 Views
Input
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 02 Jun 2008, 08:23 PM
I need some combination of RadNumericTextBox and RegularExpressionValidator to allow for a number between -0.9999 and 0.9999.  The user must not be able to enter any fewer or any greater number of digits.  Can anyone help?

2 Answers, 1 is accepted

Sort by
0
Charles
Top achievements
Rank 1
answered on 02 Jun 2008, 08:28 PM
Here is what I have so far:

                <asp:RegularExpressionValidator EnableClientScript="false" ID="decimalCheckAdjustment"
                    ControlToValidate="radMaskedRateAdjustment" ValidationExpression="^(\-)?[0]?\.\d(\d?){3}$"
                    Text="*" runat="server" ErrorMessage="Base rate must be entered as a decimal."></asp:RegularExpressionValidator>
                <br />
                <rad:RadNumericTextBox ID="radMaskedRateAdjustment" runat="server" MaxLength="7"
                    MinValue="-0.9999" MaxValue="0.9999" NumberFormat-NegativePattern="-n" NumberFormat-DecimalDigits="4"
                    SelectionOnFocus="SelectAll" Width="125px" LabelCssClass="radLabelCss_Default"
                    Type="Number" Text='<%# DataBinder.Eval( Container, "DataItem.RateAdjustment") %>'>
                </rad:RadNumericTextBox>
0
Missing User
answered on 03 Jun 2008, 08:06 AM
Hello Charles,

You can use Max/MinValue properties of the RadNumericTextBox.

Here is an example:

            <telerik:RadNumericTextBox  
                ID="RadNumericTextBox1"  
                runat="server"  
                MaxValue="0.9999"  
                MinValue="-0.9999"
            </telerik:RadNumericTextBox> 

MaxValue Property - Gets or sets the largest possible value of a RadNumericTextBox.  The default value is positive 70368744177664.

MinValue Property - Gets or sets the smallest possible value of a RadNumericTextBox.   The default value is negative -70368744177664.


Sincerely yours,
Plamen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Input
Asked by
Charles
Top achievements
Rank 1
Answers by
Charles
Top achievements
Rank 1
Missing User
Share this question
or