Are you using edatagrid plugin and calling 'addRow' method to append a new row? If so, get the first editor object and make it get focus after calling the 'addRow' method. The code looks like this:
var dg = $('#tt');
dg.edatagrid('addRow');
var index = dg.edatagrid('getRows').length-1; // the editing row index
var ed = dg.edatagrid('getEditors', index)[0]; // get the first editor
$(ed.target).focus();