I tried to add this code at refreshHeader event but it does not sort correctly.
// Get Group Model
var gModel = $(gridDiv).pqGrid( "option", "groupModel");
// Get Sort List
var sortModel = $(gridDiv).pqGrid( "option", "sortModel");
var sortList = sortModel.sorter;
var groupList = gModel.dataIndx;
// add the grouped columns to the front of sort list
for (var i=groupList.length-1; i>=0; i--) {
var grpIdx = groupList[i];
// remove grpIdx from sortList
sortList = $.grep(sortList, function (el) { return el.dataIndx!= grpIdx; });
// add grpIdx to front of sortList
sortList.splice(0,0,{dataIndx:grpIdx, dir: "up"})
}
// Apply new sortList
sortModel.sorter = sortList;
$(gridDiv).pqGrid( "option", "sortModel", sortModel );