We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Grid Edit Needs Up/Down Arrow Keys to Behave Like Enter

Hello,

This may be a quick and easy answer but I haven't been able to find it.

I have a grid control in Batch Edit Mode.  I want to be able to enter data and then move onto the next cell by using the Up/Down Arrow keys just like the Enter key moves you to the next cell.  Is this possible?

Thanks,
Nick

5 Replies

VA Venkatesh Ayothi Raman Syncfusion Team June 20, 2016 07:34 AM UTC

Hi Nick, 

Thank you for contacting Syncfusion support. 

Yes we can change the keyboard activities using Create event in the Grid and this event triggered while grid rendered fully. So we can modify the default key configuration as per your requirement.  
We have created a following sample for your requirement. Please refer to code example and Help document, 


Code example: 
<Grid> 
@(Html.EJ().Grid<object>("FlatGrid") 
        .Datasource((IEnumerable<object>)ViewBag.datasource) 
        .AllowScrolling() 
         .AllowPaging()    /*Paging Enabled*/ 
              .SelectionType(SelectionType.Single) 
              .EditSettings(edit=>{edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch); }) 
               
 . . .  
 
              .ClientSideEvents(eve=>eve.Create("create")) 
        .Columns(col => 
        { 
            . . . 
            
        })) 
<Create Event> 
function create(args) { 
 
        args.model.keyConfigs.downArrow = ""; //Remove the default Fucntionalities 
        args.model.keyConfigs.upArrow = "";//Remove the default Fucntionalities 
        args.model.keyConfigs.moveCellLeft = "shift+9,38"; // Using uparrow to move cell left 
        args.model.keyConfigs.moveCellRight = "9,40"; //Using down arrow to move cell right 
 
    } 



If we misunderstood your query then could you please provide more details for your requirement? 

Regards, 
Venkatesh Ayothiraman. 



NP Nicholas Paradiso June 20, 2016 11:37 PM UTC

This is exactly what I need except the up arrow does not take me to the previous cell unless the cursor is at the beginning of the cell.  If I type and then click the up arrow it says in the current cell.

Also, is there any documentation on this model.keyConfigs?  I can't find any reference to it in the online help.

Thanks,
Nick


VA Venkatesh Ayothi Raman Syncfusion Team June 21, 2016 12:07 PM UTC

Hi Nick, 

Thank you for the update. 

We were unable to reproduce the issue at our end. Could you please share the following details? 
1)      Browser details. 
2)      Essential Studio Version details. 
3)      Any script error thrown in console window? If so, provide screenshot. 

It would be helpful for us to find the issue and provide the better solution as earliest. 

Regards, 
Venkatesh Ayothiraman. 



NP Nicholas Paradiso June 21, 2016 07:11 PM UTC

Hello,

I am using Internet Explorer 11 and Essential Studio 14.1.0.41.

If I click on a cell to edit and then use the up and down arrows everything moves correctly.  BUT if I click on a cell to edit and type something and then click the up arrow nothing happens, but the down arrow works.  Another interesting observation is that if I click in the middle of a word in the cell and edit so that the cursor remains in the middle of the word, then the up and down arrow do not move it to the next cell.  The arrows only work if the entire text is highlighted or if the cursor is at the end it will move to the right cell and if it is at the beginning it will move to the left cell. 

I could live with this limitation if it is a limitation and not an error.

Thanks,
Nick




VA Venkatesh Ayothi Raman Syncfusion Team June 22, 2016 02:04 PM UTC

Hi Nick, 

Thank you for the update. 

The cursor doesn’t move left or right while press the Up/Down arrow keys in the IE browser. This is the default behavior of IE browsers. For this reason, the current cell doesn’t move left or right while press the Up/Down keys in the Grid.  

We have also checked with the normal input box with IE browser. For reference we have created a sample. Please refer to the sample, 


Note: we can move the next or previous cell using Up/Down arrows keys with some limitations. The limitation is, we can move to right/left cell when cursor position is moved to last/first position of word.   

Regards, 
Venkatesh Ayothiraman. 


Loader.
Live Chat Icon For mobile
Up arrow icon