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

How to set initial/default value for RadNumericTextbox?

1 Answer 559 Views
Input
This is a migrated thread and some comments may be shown as answers.
JD.
Top achievements
Rank 1
JD. asked on 18 Jun 2012, 02:10 AM
Hi,

After I added DbValue property, the default/initial value "0"  disappears.  
<telerik:RadNumericTextBox ID="RadNumericTextBox1" Runat="server"
CssClass="AlignRight" Culture="en-US"
Value="0" DataType="System.Decimal"
DbValue ='<%# Bind( "RateValue") %>'
LabelWidth="64px" Width="160px">
<NumberFormat ZeroPattern="n"></NumberFormat>
<DisabledStyle HorizontalAlign="Right" />
</telerik:RadNumericTextBox>

Regards

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 19 Jun 2012, 12:54 PM
Hello J,

The described behaviour is expected since, you're passing it a null value, which the control accepts. I would suggest handling the client-side load event and set the default value accordingly. Like so:

function OnLoad(sender, args) {
    if (sender.isEmpty()) {
        sender.set_value(0);
    }
}

I hope that helps.
Tags
Input
Asked by
JD.
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Share this question
or