Please call 'collapseGroup' method on all groups when loaded data successfully.
$('#dg').datagrid({
onLoadSuccess:function(){
var gcount = $(this).datagrid('options').view.groups.length;
for(var i=0; i<gcount; i++){
$(this).datagrid('collapseGroup', i);
}
}
})