RadNumericTextBox - showing all decimal digits in edit mode?

3 posts, 1 answers
  1. Mark DeMichele
    Mark DeMichele avatar
    74 posts
    Member since:
    Oct 2005

    Posted 11 Apr 2008 Link to this post

    Hi,

    I have a page with a RadNumericTextBox with NumberFormat-DecimalDigits=2.

    Suppose I have the value "1.95". In display mode, it shows 1.95 which is correct. When I focus and go into edit mode, I get 1.95. That's also correct.

    But if I have a value of "1.00", it doesn't display the .00 in edit mode. It only displays 1. Is there a way to get it to display all the decimal places, even if they are zeros? It looks and feels very odd to the user since it displays 1.00 but changes to 1 when editing. Thanks!
  2. Answer
    John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 14 Apr 2008 Link to this post

    hi: )

    Here is an example how to achieve your goal

                <script type="text/javascript"
                function RadNumericTextBox1_Focus(sender, args) 
                { 
                    sendersender._textBoxElement.value = sender.get_displayValue(); 
                } 
                </script>         
                <telerik:RadNumericTextBox Value="1" ID="RadNumericTextBox1" runat="server"
                    <ClientEvents OnFocus="RadNumericTextBox1_Focus" /> 
                </telerik:RadNumericTextBox> 

    Regards...
    <John:Peel />


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mark DeMichele
    Mark DeMichele avatar
    74 posts
    Member since:
    Oct 2005

    Posted 14 Apr 2008 Link to this post

    Thanks. That solution works great!
Back to Top