4 Answers, 1 is accepted
0
Jocelyn
Top achievements
Rank 1
answered on 27 Feb 2012, 03:33 PM
Nobody can help me?
0
Richard
Top achievements
Rank 1
answered on 27 Feb 2012, 09:36 PM
Jocelyn:
Take a look at this forum thread which covers your issue in depth: Feature Request : Numeric Textbox & Trailing Zeros.
If I understand your requirement, you should be able to use the "NumericTextBox1.NumberFormat.DecimalDigits = 0;" setting to trim the trailing "0"s. See Formatting Numeric Values
Hope this helps!
Take a look at this forum thread which covers your issue in depth: Feature Request : Numeric Textbox & Trailing Zeros.
If I understand your requirement, you should be able to use the "NumericTextBox1.NumberFormat.DecimalDigits = 0;" setting to trim the trailing "0"s. See Formatting Numeric Values
Hope this helps!
0
Jocelyn
Top achievements
Rank 1
answered on 02 Mar 2012, 09:42 PM
I tried what the guy said. It is not working for me.
When I try this is debug:
It removes the trailling zeros, but when this function is done, the trailling zeros come back... In debug, zeros come back when this.updateDisplayValue() is called.
When I try this is debug:
function
PoidsTaille_OnValueChanged(sender, eventArgs)
{
var
v = eventArgs.get_newValue().toString();
sender._textBoxElement.value = v;
PoidsTaille_Changed(sender._clientID, eventArgs.get_newValue());
}
It removes the trailling zeros, but when this function is done, the trailling zeros come back... In debug, zeros come back when this.updateDisplayValue() is called.
0
Hi Jocelyn,
You could override the get_displayValue function that is used for generating the display value and apply your custom format instead of using these from the Telerik.Web.UI.NumberFormat.
Here is an example:
Kind regards,
Vasil
the Telerik team
You could override the get_displayValue function that is used for generating the display value and apply your custom format instead of using these from the Telerik.Web.UI.NumberFormat.
Here is an example:
<
script
type
=
"text/javascript"
>
Telerik.Web.UI.RadNumericTextBox.prototype.get_displayValue = function ()
{
var value = this.get_value();
return value.toString(); //or apply your custom format here
}
</
script
>
<
telerik:RadNumericTextBox
runat
=
"server"
>
</
telerik:RadNumericTextBox
>
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.