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

Navigation in RadSpreadsheet

4 Answers 122 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Joy
Top achievements
Rank 1
Joy asked on 14 May 2014, 07:01 PM
Hello,

I have a requirement where user should be able to traverse through the spreadsheet columns vertically using only Tab or Enter Key.
For ex: If I have entered some value in column1, cell 1, when I press Tab, focus should move on to the next cell in the same column1. and I should be able to keep doing this for, suppose, next 1000 rows.  Then I would like to start on column2, cell1, and do the same traversal using Tab key or Enter key and so on.
So my question is how do I capture the tab key press event or enter key press event and move the focus on to the next cell below the current cell ( not the cell on the right side)  for data entry ?

I would really appreciate the quick response.
Thank you.

4 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Demirev
Telerik team
answered on 15 May 2014, 07:47 AM
Hello Jyotsna,

The RadSpreadsheet provides a simple way to bind a key to a command. The following example shows how using the Enter key to set the cell style to "Bad".

this.radSpreadsheet.ActiveSheetEditorChanged += this.RadSpreadsheet_ActiveSheetEditorChanged;
 
private void RadSpreadsheet_ActiveSheetEditorChanged(object sender, EventArgs e)
{
    RadWorksheetEditor worksheetEditor = this.radSpreadsheet.ActiveWorksheetEditor;
    if (this.radSpreadsheet.ActiveWorksheetEditor != null)
    {
        worksheetEditor.KeyBindings.RegisterCommand(worksheetEditor.Commands.SetStyleCommand, Key.Enter, ModifierKeys.None, "Bad");
    }
}

Please bear in mind that if there is already key binding assigned to that key it will be replaced with the new one.

I hope this helps. Feel free to write back if you have any further questions.

Regards,
Nikolay Demirev
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Joy
Top achievements
Rank 1
answered on 15 May 2014, 06:48 PM
Thanks very much Nikolay for the quick reply. It really helped me moving into the right direction to solve the problem.
0
Dragosh
Top achievements
Rank 1
answered on 25 Feb 2017, 01:24 PM
Hello, regarding this issue, the provided solution works only if you are not in edit mode. After you edit a cell and hit Enter, the command is no longer fired. Is there a workaround for this case ?
0
Tanya
Telerik team
answered on 27 Feb 2017, 06:00 PM
Hi Dragos,

I just replied the support thread you have submitted. Let's continue our conversation there to keep it consistent. Thank you for understanding.

Regards,
Tanya
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.
Tags
Spreadsheet
Asked by
Joy
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
Joy
Top achievements
Rank 1
Dragosh
Top achievements
Rank 1
Tanya
Telerik team
Share this question
or