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

Do a post back with keyboard navigation

2 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Miguel
Top achievements
Rank 1
Miguel asked on 01 Dec 2016, 10:25 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Marin
Telerik team
answered on 05 Dec 2016, 12:05 PM
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.
0
Miguel
Top achievements
Rank 1
answered on 09 Dec 2016, 03:50 PM
thank you, I actually ended up not requiring a post back, but your information was still very useful.
Tags
Grid
Asked by
Miguel
Top achievements
Rank 1
Answers by
Marin
Telerik team
Miguel
Top achievements
Rank 1
Share this question
or