Excel-like arrow key navigation behavior for WPF form

7 posts, 0 answers
  1. Gaoming
    Gaoming avatar
    13 posts
    Member since:
    Mar 2017

    Posted 01 Mar Link to this post

    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.

  2. Stefan
    Admin
    Stefan avatar
    792 posts

    Posted 06 Mar Link to this post

    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.
  3. Stefan
    Admin
    Stefan avatar
    792 posts

    Posted 09 Mar Link to this post

    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.
  4. Gaoming
    Gaoming avatar
    13 posts
    Member since:
    Mar 2017

    Posted 09 Mar in reply to Stefan Link to this post

    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.

     

     

     

     

  5. Stefan
    Admin
    Stefan avatar
    792 posts

    Posted 14 Mar Link to this post

    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.
  6. Gaoming
    Gaoming avatar
    13 posts
    Member since:
    Mar 2017

    Posted 14 Mar in reply to Stefan Link to this post

    Thanks.
  7. Gaoming
    Gaoming avatar
    13 posts
    Member since:
    Mar 2017

    Posted 14 Mar in reply to Stefan Link to this post

    Thanks.
Back to Top