Block decimal separetor

2 posts, 0 answers
  1. GD
    GD avatar
    29 posts
    Member since:
    Nov 2008

    Posted 05 Jan 2010 Link to this post

                    <telerik:RadNumericTextBox ID="txtUURiferimento1"   
                                               runat="server" 
                                               Value='<%# Bind("CodUnitaUrbanisticaRiferimento1") %>'   
                                               NumberFormat-AllowRounding="false" 
                                               NumberFormat-DecimalDigits="0" 
                                               DataType="System.Int32?">  
                    </telerik:RadNumericTextBox> 

    When "DecimalDigits=0" is possible block decimal separetor how letter and special char are blocked?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Jan 2010 Link to this post

    Hello Claudio,

    Yes Claudio, I tried the code and it worked perfectly for me. Here is my code.

    ASPX:
     
    <telerik:RadNumericTextBox ID="txtUURiferimento1" runat="server"  
        NumberFormat-AllowRounding="false" NumberFormat-DecimalDigits="0" DataType="System.Int32?"
        <ClientEvents OnKeyPress="OnKeyPress" /> 
    </telerik:RadNumericTextBox> 

    JavaScript:
     
    <script type="text/javascript"
        function OnKeyPress(sender, eventArgs) { 
            var c = eventArgs.get_keyCode(); 
            if (c == 46) 
                eventArgs.set_cancel(true); 
        } 
    </script> 

    -Shinu.
Back to Top