You can call 'expandRow' or 'collapseRow' methods to expand or collapse a row. If you want to keep all rows expanded when loading data successfully, please try the following code.
$('#dg').datagrid({
onLoadSuccess:function(){
var count = $(this).datagrid('getRows').length;
for(var i=0; i<count; i++){
$(this).datagrid('expandRow', i);
}
}
})