[DevExpress Support Team: CLONED FROM T363560: ASPxGridView - Batch Edit - Provide cell focusing and keyboard navigation]
This isn't really good enough for users, surely there should be an easy way for them to create a new row, without potentially having to scoot about all over that grid?
GridView - How to implement a shortcut to add a new row
Answers approved by DevExpress Support
Hello Robert,
I've forwarded this scenario to our developers. They will discuss it when planning further development of the control.
Now I can suggest you handle the client-side Init event of your GridView and implement your own shortcut to add a new row. In my sample I used the "F4" button:
ASPxfunction OnInit(s, e) { ASPxClientUtils.AttachEventToElement(s.GetMainElement(), "keydown", function (evt) { if (evt.keyCode === 115) //key code of F4 button s.AddNewRow(); }); }
Please review the attached project and let me know if this approach helps.
Regards,
Vova
I half solved this problem by doing the following:
Registering the key up event:
and then doing this :
Import: { CreateNewRow(s, e) { if (e.htmlEvent.keyCode == 13 || e.htmlEvent.keyCode == 9) { myGrid.AddNewRow(); } } }
However, I would opt for anything that's built in to solve this same problem. It seems this method is a little temperamental, in that when I'm on that last column, it doesn't always accept the tab key as having been pressed