I use the WebDataGrid.InitializeDefaultEditors.
In my event handler I have written the following code:
void OnInitializeDefaultEditors(object sender, DefaultEditorsEventArgs e){ e.NumericEditor.Buttons.SpinOnArrowKeys = false; e.NumericEditor.ClientEvents.KeyDown = "j_onNumericEditorKeyDown";}
The SpinOnArrowKeys is succesfully disabled, but the KeyDown event is not fired.
Hi,
I added your codes to a sample page with grid, but I could not reproduce that issue. I implemented KeyDown by following, and event was raised for all keys including up/down arrows (output lines were "key:38", "key:40").
<script type="text/javascript"> function j_onNumericEditorKeyDown(editor, args) { _bug4('key:'+args.get_browserEvent().keyCode); } </script>
I tested IE7 and Firefox.It is possible that something else interacts with key events. I suggest you to test a temporary page which has only grid and that event handler.
Hi Viktor,
Thanks for your answer. I registered the event in my page constructor. Once I moved the event registration to the page load event it works.
I have a follow-up question. I hope you can help me. How do I get a reference to the grid cell which is being edited, when the keydown event of the numeric editor fires?
Roland