Yeah, it's true that this is not a very conventional approach, and is basically what you said you considered doing, but I found this was the easiest way to get all the rows selected and also have the header checkbox selected:
var grid = $("#my_grid");
grid.resetSelection();
$('#cb_my_grid').click();
var ids = grid.getDataIDs();
for (var i=0, il=ids.length; i < il; i++ )
grid.setSelection(ids[i], false);
I suppose the rows don't get selected when the header checkbox is programmatically clicked because of the jqGrid underlying implementation, like you said? I don't know the way it works underneath, but this seems to work for me on top for now.
The main reason I want to make sure the header checkbox gets selected in my grids is so the user can subconsciously determine that yes, all the rows in the grid are definitely selected right now (including ones not visible below the current scroll view), and not have to click the header checkbox just to make sure.
@Craig -- I'll have to try your method, it seems simpler and more reasonable