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

Dont allow decimal in RadNumeric Textbox

1 Answer 15 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Atchut
Top achievements
Rank 1
Atchut asked on 18 Jul 2012, 02:32 PM
Hello,

I am having a textbox and it shouldnot allow decimal values. It should allow only whole numbers.

How can I do this ?

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 18 Jul 2012, 02:57 PM
Hello,

function KeyPress1(sender, args) {
               if (args.get_keyCharacter() == ".") {
                   args.set_cancel(true);
               }
           }
<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" >
           <NumberFormat  DecimalDigits="0" />
           <ClientEvents  OnKeyPress="KeyPress1"/>
       </telerik:RadNumericTextBox>


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Atchut
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or