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

RadNumericTextBox decimal digits zero problem

1 Answer 370 Views
Input
This is a migrated thread and some comments may be shown as answers.
Cagdas
Top achievements
Rank 1
Cagdas asked on 18 Jan 2014, 02:27 PM
Number of decimal digits will show up. Whether the trailing zeros don't appear.


KeepTrailingZerosOnFocus

Boolean

Specifies whether the control will keep its zero numbers(when set to true) and show them when it is focused, according to the DecimalDigits setting. Otherwise (when set to false) the old behavior is preserved - the control will not display decimal zeros when focused. By default this property is set to false.


This behavior works radnumrecitextbox mouse click event.

Do not click the mouse when not in radnumrecitextbox zero

RadNumeticTextBox

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 21 Jan 2014, 08:12 PM
Hello Cagdas,

The behavior that you are referring to is expected. As the property clearly states, it applies only for the trailing zeros when the input is on focus. When the input is blurred, the DecimalDigits property will be take into account and if there are trailing zeros available, they will be visible.

However, if you want to remove the trailing zeros regardless the DecimalDigits property you could use the following approach:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function numericTextBox1Load(sender, args) {
            sender.set_textBoxValue(sender.get_value().toString());
        }
 
        function numericTextBox1Blur(sender, args) {
            sender.set_textBoxValue(sender.get_value().toString());
        }
    </script>
</telerik:RadCodeBlock>
 
<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" NumberFormat-DecimalDigits="3" Value="200.22000">
    <NumberFormat AllowRounding="true" KeepNotRoundedValue="false" />
    <ClientEvents OnBlur="numericTextBox1Blur" OnLoad="numericTextBox1Load" />
</telerik:RadNumericTextBox>

Hope that helps.


Regards,
Konstantin Dikov
Telerik
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 the blog feed now.
Tags
Input
Asked by
Cagdas
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or