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

RadGrid Up/Down navigation while in edit mode

2 Answers 159 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Don
Top achievements
Rank 1
Don asked on 13 Jul 2015, 06:02 AM

We have a requirement where user wanted to use the up/down keys to navigate rows while the grid is in edit mode.  I was able to achieve this using the Keydown event of the RadnumericTextBox, but the edited value seems to revert back to the original value when user press the navigation keys.  We are using Batchedit mode so I would like to get to get the red mark on the edited row before it changes the focus to the next row.  Could this be achieved?  Below is the Javascript I'm calling in the Keydown event of RadnumericTextBox.


function OnKeyDown(sender, args) {
    var key = args.keyCode;
    var grid = $find("<%=grid.ClientID%>");
    var data = grid.get_batchEditingManager().get_currentlyEditedCell();
    var tableView = grid.get_masterTableView();
  
    if (key == 38) { //Up Key
        var row = grid.get_batchEditingManager().get_currentlyEditedRow();
        if (row.previousSibling) {
            grid.get_batchEditingManager().openRowForEdit(row.previousSibling);
        }
    }
    else if (key == 40) { //Down key
        var row = grid.get_batchEditingManager().get_currentlyEditedRow();
        if (row.nextSibling) {
            grid.get_batchEditingManager().openRowForEdit(row.nextSibling);
        }
    }
}

2 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 15 Jul 2015, 12:24 PM
Hello,

For your convenience I have prepared a sample project where the functionality is implemented. Give the attachment a try and let me know how it works for you.

Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Phillip
Top achievements
Rank 1
answered on 30 Mar 2016, 02:32 PM
Late reply, but thank you Viktor! Your example helped solve this exact problem for me. 
Tags
Grid
Asked by
Don
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Phillip
Top achievements
Rank 1
Share this question
or