RadGrid Up/Down navigation while in edit mode

3 posts, 0 answers
  1. Don
    Don avatar
    1 posts
    Member since:
    Nov 2014

    Posted 13 Jul 2015 Link to this post

    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. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 15 Jul 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Phillip
    Phillip avatar
    1 posts
    Member since:
    Nov 2015

    Posted 30 Mar in reply to Viktor Tachev Link to this post

    Late reply, but thank you Viktor! Your example helped solve this exact problem for me. 
Back to Top