RadDataGrid multiselection and arrow key navigation

1 Answer 15 Views
DataGrid
Simon
Top achievements
Rank 1
Simon asked on 13 Mar 2024, 08:46 AM

Hi,

I would like to use SelectionMode="Extended" for my DataGrid and still be able to navigate through/select rows with arrow keys. Setting IsSynchronizedWithCurrentItem="True", however, disables multiselection. Is there a way to combine the two behaviors?

Thanks for your help

Regards

Simon

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 15 Mar 2024, 04:17 PM

Hello Simon,

When the IsSynchronizedWithCurrentItem property of RadDataGrid is set to True, the SelectedItem property's value will be updated, so that it is synchronized with the CurrentItem object. The observed behavior on your end is the default and expected one.

With this in mind, a possible approach for retaining the arrow navigation while there are selected items would be to disable the synchronization with the current item. Is there any requirement in your application to keep the selected item synchronized with the current one? If yes, would it be possible to share it, so I can review it and see if I can suggest an alternative approach that will allow you to keep the arrow navigation?

Regards,
Stenly
Progress Telerik

A brand new ThemeBuilder course was just added to the Virtual Classroom. The training course was designed to help you get started with ThemeBuilder for styling Telerik and Kendo UI components for your applications. You can check it out at https://learn.telerik.com
Simon
Top achievements
Rank 1
commented on 19 Mar 2024, 01:29 PM

Hi Stenly,

thanks for your help. Disabling the synchronization is what I did for now. But it makes navigation within the DataGrid a bit cumbersome. I was hoping for a behavior similar to spreadsheet apps like Excel. You can select a single cell with the arrow keys and when holding down the shift key, you can select multiple cells, also using the arrow keys.

With synchronization disabled, you have to hit the space key in order to change the selection, which feels really uncommon.

Regards,

Simon

Tags
DataGrid
Asked by
Simon
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or