Override default key event methods

4 posts, 1 answers
  1. Kevin
    Kevin avatar
    22 posts
    Member since:
    Feb 2014

    Posted 11 Dec 2014 Link to this post

    Hi,

    We're using numeric textboxes in a grid that allows for keyboard navigation.  The problem is that the up/down arrows still increase and decrease the values in the textbox before the navigation event occurs.  Is there a way to disable the default key events, or modify them?

    Thanks,
    Kevin
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 13 Dec 2014 Link to this post

    Hello Kevin,

    I am afraid that is not very clear what "navigation" event occurs when value of NumericTextBox is increased/decreased. Could you elaborate more on this requirement?

    In general, widget's keyboard navigation is enabled by default and cannot be prevented nor modified. If you need to change widget behavior, then you will need to override its current implementation.

    Best regards,
    Georgi Krustev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Kevin
    Kevin avatar
    22 posts
    Member since:
    Feb 2014

    Posted 15 Dec 2014 in reply to Georgi Krustev Link to this post

    Hi George,

    To elaborate, we've designed a grid so that when the user presses the arrow keys it shifts focus to the control in that direction.  So the up arrow key moves the focus to the element in the row above, and down arrow sets the focus on the element in the row below.  

    This is working but it's also increasing or decreasing the value in the NumericTextBox at the same time.  I was hoping to find out how to disable this increment/decrement behaviour on keypress.

    Thanks,
    Kevin
  5. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 17 Dec 2014 Link to this post

    Hello Kevin,

    The only way to disable the increment/decrement behavior is to unbind current "keydown" event handler. Here is a Dojo demo that demonstrates one possible implementation. 

    Regards,
    Georgi Krustev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready