Stop OnKeyDown increase NumericTextBox

1 Answer 88 Views
NumericTextBox
Ben
Top achievements
Rank 1
Ben asked on 06 Sep 2023, 02:00 PM

Hi, 

I would like to stop the incrementing of my NumericTextBox when I use the keyboard arrows. I use preventDefault, but it doesn't work.

<div @onkeydown:preventDefault="true">
     <TelerikNumericTextBox Id="test" Width="95%" Decimals="2" Format="C2" @bind-Value="@Test" Arrows="false"> 
     </TelerikNumericTextBox>
</div>

Can anyone help me?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Zachary
Top achievements
Rank 1
Iron
answered on 06 Sep 2023, 03:08 PM | edited on 06 Sep 2023, 03:10 PM

Hi Benoit,

If you set the Step property of the TelerikNumericTextBox to "0", that should prevent the number from changing with the up/down arrow keys.

Ben
Top achievements
Rank 1
commented on 06 Sep 2023, 08:24 PM

Thank's Zachary. 

I want to do the same with the TelerikDatePicker. I don't see any option like Step and I don't think PreventDefault will be my solution. So I come back to the same problem for the date.

Tags
NumericTextBox
Asked by
Ben
Top achievements
Rank 1
Answers by
Zachary
Top achievements
Rank 1
Iron
Share this question
or