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
300
Disable the Enter key in New Row
posted

Hi

I'm trying to stop a new row being added with the press of Enter on the new row.  The reason for this is that we have required field validators on some fields, but not all, so if the user clicks in a field that does not have a validator and presses enter it saves this row without performing the validation. 

According to the forum post http://ko.infragistics.com/community/forums/t/66546.aspx - we are supposed to be able to trap the KeyDown event but this event does not seem to fire if we press enter in either the New Row or if pressing enter while editing a cell.  The event DOES fire if I press any alphanumeric keys.  This is the javascript we have on the KeyDown event and the window.alert does not get displayed when Enter is pressed but does for other keys.


function WebDataGridDebt_Grid_KeyDown(sender, eventArgs)
{
    window.alert('keydown');
    if (eventArgs.get_browserEvent().keyCode == 13) {
        enterKey = true;
    }
}

Can you please let me know the best method for disabling the Enter key on the new row (ie, I don't want this to commit the row)

Thanks

Marcus