RadNumericTexBox Double Decimal Separator

3 posts, 0 answers
  1. Anthony
    Anthony avatar
    2 posts
    Member since:
    Aug 2010

    Posted 29 Nov 2010 Link to this post

    Hi,
    I've had a RadnumericTextbox on my page :

    <telerik:RadNumericTextBox runat="server" ID="txbOCCCplafond" SkinID="txbEntier" NumberFormat-decimalSeparator=',' MinValue="0" />

    As you can see the decimal separator is the comma (french format).

    I would like to allow the user to press ',' or '.' (as a result the '.' becomes ',')

    For example setting NumberFormat-DecimalSeparator= ',.'

    Hope you understand my poor english

    Could you help me ?



     

     



     

  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 29 Nov 2010 Link to this post

    Hello Anthony,

    Please try the following script:
    <script type="text/javascript">
        function keyPress(sender,args)
        {
            if (args.get_keyCharacter() == ".")
            {
                sender.set_textBoxValue(sender.get_value() + ",");
                args.set_cancel(true);
            }
        }
    </script>
    <telerik:RadNumericTextBox runat="server" ID="txbOCCCplafond" SkinID="txbEntier"
        NumberFormat-DecimalSeparator=',' MinValue="0">
        <ClientEvents OnKeyPress="keyPress" />
    </telerik:RadNumericTextBox>

    I hope this helps.

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Anthony
    Anthony avatar
    2 posts
    Member since:
    Aug 2010

    Posted 29 Nov 2010 Link to this post

    This work fine !

    thank you very much, Daniel
Back to Top