The event the fires on the client-side upon colunm sorting is called ColumnSort, e.g.
<trirand:JQGrid runat="server" ID="JQGrid1" DataSourceID="SqlDataSource1"> <ClientSideEvents ColumnSort="columnSort" /> </trirand:JQGrid>
Once defined in the grid, the event also needs to be defined as a javascript function. This particular event receives three parameters:
e.g.
function columnSort(fieldName, columnIndex, sortOrder) { var line = "<b>Column sorted</b>: " + fieldName + "; Index: " + columnIndex + "; sortOrder: " + sortOrder + "<br/>"; $("#log").append(line); }
jqGrid exposes the client-side sortGrid method with two parameters
e.g.
<script type="text/javascript"> function forceSort() { var grid = $("#<%= JQGrid1.ClientID %>"); grid.sortGrid("Freight", true); } </script>