Extend a 'groups' method to get all the groups.
$.extend($.fn.propertygrid.methods, {
groups: function(jq){
var opts = jq.propertygrid('options');
return opts.showGroup ? jq.datagrid('options').view.groups : [];
}
});
To expand/collapse a group, calculate the group index and then call 'expandGroup' or 'collpaseGroup' methods to achieve it.
var groupName = 'Status';
var pg = $('#pg');
var groups = pg.propertygrid('groups');
var index = $.inArray(groupName, $.map(groups, function(g){return g.value}));
pg.propertygrid('collapseGroup', index);