Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
Problems with pressing enter key in a disabled column
posted

Hi,
I have a problem with webdatagrid when pressing enter key in a disabled column. I need grid events (as Row Adding) to be fired when
pressing enter key in a disabled column, but instead that, the next control event is fired (like button click for example).

KeyEnterTest.zip
  • 20255
    Offline posted

    Hello Edward,

    Thank you for contacting us.

    This is the default behavior of our WebDataGrid, the new row will be added if you are at the last available cell and hit enter, although we can easily workaround this. I have modified your sample and now when enter is hit, if the focus is at any cell of the "Add New Row" section, the row will be committed.

    Code snippet:

    1. <script type="text/javascript">
    2.     $(function () {
    3.         $(document).keypress(function (e) {
    4.             if ((e.which == 13) && ($("tr .igg_AddNewRow").hasClass("igg_ActiveRow"))) {
    5.                 ig_controls.wdgKeyEnterTest.get_behaviors().get_editingCore().get_behaviors().get_rowAdding()._commitRow();
    6.             }
    7.         });
    8.     });
    9. </script>


    Let me know if I may be of further assistance.

    KeyEnterTest.zip