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

[Solved] Keyboard shortcut

2 Answers 94 Views
Grid for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jean
Top achievements
Rank 1
Jean asked on 24 Jul 2014, 04:33 PM
Is there a way with the keyboard to set the selected Item, I wish the enter key would do it but it just moves from one row to another without selecting anything. Is there another trick?

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivaylo Gergov
Telerik team
answered on 29 Jul 2014, 12:40 PM
Hi Jean,

Currently the RadDataGrid handles the KeyDown event when the Enter key has been pressed and it does not fire. We will consider to implement a command that will allow customizing this behavior. For now, I can suggest a simple workaround: You can inherit the RadDataGrid class and override its protected OnKeyDown method like this: 
public class DataGrid : RadDataGrid
{
    protected override void OnKeyDown(KeyRoutedEventArgs e)
    {
        if (e.Key == Windows.System.VirtualKey.Enter)
        {
            this.SelectedItem = this.CurrentItem;
        }
        else
        {
            base.OnKeyDown(e);
        
    }
}

I hope this helps.

Regards,
Ivaylo Gergov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jean
Top achievements
Rank 1
answered on 14 Aug 2014, 12:13 AM
That worked
Tags
Grid for XAML
Asked by
Jean
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Jean
Top achievements
Rank 1
Share this question
or