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

Excel-like arrow key navigation behavior for WPF form

6 Answers 294 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gaoming
Top achievements
Rank 1
Gaoming asked on 01 Mar 2017, 09:30 PM

Hi,

I was asked to implement the Excel-like arrow key navigation behavior for RadGridView.

These days users use Microsoft products as a standard. In Excel:

1. After users double click on a cell, with or without making any changes, users cannot leave the cell using arrow keys.

    They can leave the cell by clicking on other cell or using Tab

2. When users enter a cell by Tab or one single mouse clicking, with or without making any changes, users can leave the cell using arrow keys.

I want to do the same in RadGridView.

Thanks in advance for help.

6 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 06 Mar 2017, 12:05 PM
Hi Gaoming,

The required behavior is actually the default one of RadGridView. When the user clicks twice, the cell enters edit mode and the user cannot navigate through the other cells with the arrow keys. The edit needs to be committed in order to do that. Respectively, on a single click the control is in view mode and the user can navigate through the cells with the arrow keys. Can you please check this out?

In addition, you may find the Keyboard Support and Updating an Entry topics useful on this matter.

All the best,
Stefan X1
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Stefan
Telerik team
answered on 09 Mar 2017, 03:43 PM
Hi Gaoming Fu,

I will paste the enquiry you sent through your e-mail here, so that the communication is kept consistent.

From the trial version, I cannot see the default you mentioned. I also posted the following question: I want to change the style of selected cell of RadGridView in my WPF form. I found the following style from RadGridView documentation and I used it. <Style TargetType="{x:Type telerik:GridViewEditorPresenter}"><Setter Property="Template" Value="{StaticResource GridViewEditorPresenterTemplate}"/><Setter Property="Padding" Value="5"/></Style> However, I got the warning error "Resource GridViewEditorPresenterTemplate is not found." Do I need to include some assemblies in my xaml file? Also, in Excel, if I use mouse to select a range of cells, there is a solid black border for all the selected ranges, can we do the same for RadGridView selected cells? Can you please have a look at this issue? Thanks.

Best regards, Gaoming Fu

I have prepared a short video demonstrating the default behavior of the control. You can find it attached to my reply. Is this the behavior you are aiming at, or I am missing something?

As to styling the selected cell, I have replied you in the Assembly for GridViewEditorPresenterTemplate thread you opened.

Unfortunately, there is no out-of-the-box approach for applying such customization. You can take a look at the Selection section of RadGridView's help for reviewing the built-in mechanism that the control provides.

Regards,
Stefan X1
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Gaoming
Top achievements
Rank 1
answered on 09 Mar 2017, 08:10 PM

Thank you very much for the demo. Yes, it is what we are looking for. We solved the arrow key navigation issue.

We are still looking for a solution for the solid border of selected cells. I did have a look at

the selection section of RadGridView documentation for WPF but did not find any helpful information.

 

 

 

 

0
Stefan
Telerik team
answered on 14 Mar 2017, 03:37 PM
Hi Gaoming Fu,

As mentioned in my previous reply, the control does not support applying such customization. The selection mechanism supports multiple cells selection, but the Style applied for the selected cells is the same. In other words said, there is no way to determine whether a cell is an outer one for a given range of cells or not and thus apply a different Style to it.

I hope I've managed to clarify your concern.

Regards,
Stefan X1
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Gaoming
Top achievements
Rank 1
answered on 14 Mar 2017, 07:25 PM
Thanks.
0
Gaoming
Top achievements
Rank 1
answered on 14 Mar 2017, 07:26 PM
Thanks.
Tags
General Discussions
Asked by
Gaoming
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Gaoming
Top achievements
Rank 1
Share this question
or