When calling 'select' method to move page to next, the data is not loaded immediately. You are 'highlightRow' an un-existing row, this is why errors happen. To solve this issue, please call 'highlightRow' method after loading data successfully.
$('#dg').datagrid({
onLoadSuccess: function(){
$(this).datagrid('scrollTo',...).datagrid('highlightRow',...);
}
});