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

Select row on keydown and keyup

1 Answer 234 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Akshay
Top achievements
Rank 1
Akshay asked on 08 Feb 2021, 01:32 PM

Is there a way to select the next row when we hit keydown or keyup using the keyboard?

 

I tried setting the navigable property to true but in that case we have to hit enter to explicitly select a row. I want to select the next row on the keydown and keyup event.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 10 Feb 2021, 08:37 AM

Hi Akshay,

The desired functionality can be achieved via some custom implementation, as it is not supported out-of-the-box.

A sample approach is to handle the regular DOM keydown event, and check the current Grid activeRow:

https://developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event

https://www.telerik.com/kendo-angular-ui/components/grid/api/GridComponent/#toc-activerow

The data item, associated with this row is available as part of the activeRow data, and can be used to modify the Grid selection programmatically:

https://www.telerik.com/kendo-angular-ui/components/grid/selection/#toc-during-data-operations

Here is a sample implementation that demonstrates the described approach:

https://stackblitz.com/edit/angular-9e4wp9?file=app/app.component.ts

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Akshay
Top achievements
Rank 1
commented on 28 May 2021, 08:42 AM

Hi Dimiter,

Thanks for your response the demo you provided worked but i am facing another issue.

When we enable the virtual scroll and the user tries to navigate up and down too fast using the keyboard up and down event, the focus is lost and it skips some rows.

It focus jumps around randomly to any row.

Let me know if you need some more details.

Regards,
Akshay
Tags
Grid
Asked by
Akshay
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or