Do a post back with keyboard navigation

3 posts, 1 answers
  1. Miguel
    Miguel avatar
    16 posts
    Member since:
    Mar 2011

    Posted 01 Dec 2016 Link to this post

    Hi,

    My application requires to have grid navigation with up/down arrow keys and this is working, however, changing the selected row does not generates

    raises the SelectedIndexChanged in the server side which I need to execute some other code to populate a panel with other information. The  SelectedIndexChanged  is only raised if a row is selected with a mouse click, and I need it to happen when changing the selected row with the arrow keys.

    How do I need to configure the Grid to support this behavior?

     

     

  2. Answer
    Marin
    Admin
    Marin avatar
    1057 posts

    Posted 05 Dec 2016 Link to this post

    Hello,

    The keyboard navigation of the grid with the arrow keys actually changes only the active row, the section is triggered only when you press the spacebar key.
    If you wish to also select a row while navigating with the arrow keys then you can handle the OnActiveRowChanged client-side event and then select the current active row through the client-side API of the grid:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/gridtableview-object/methods/selectitem

    This should select the row and also trigger the SelectedIndexChanged event when a postback is initiated. If you have set EnablePostBackOnRowClick = "true" then a postback will happen only when you click the row with the mouse.

    I hope this helps. Let me know if you have any other questions.

    Regards,
    Marin
    Telerik by Progress
    Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
  3. Miguel
    Miguel avatar
    16 posts
    Member since:
    Mar 2011

    Posted 09 Dec 2016 in reply to Marin Link to this post

    thank you, I actually ended up not requiring a post back, but your information was still very useful.
Back to Top