Assuming your page contains all the rows from your data source (no-paging) and you want to order the GridView rows on the client to increase performance (without hitting the server), you can do the following:
(This code allows sorting numbers and text and sorting in ascending and descending mode when clicking the GridView headers)
If you want to check the full working example, I just uploaded to my GitHub site
Screenshot
Unordered

First click - ASC order

Second click - DESC order

Binding the GridView
<asp:LinqDataSource runat="server" ID="lds"
ContextTypeName="WebForms_1.DataAccess.PubsDataContext"
TableName="jobs"
EntityTypeName="WebForms_1.DataAccess.jobs">
</asp:LinqDataSource>
<asp:GridView runat="server" ID="gv" DataSourceID="lds" DataKeyNames="job_id">
</asp:GridView>
jQuery code
<script type="text/javascript">
$(function () {
var $gv = $("table[id$=gv]");
var $headers = $("th", $gv);
var $rows = $("> tbody > tr:not(:has(table, th))", $gv);
$rows.addClass("grid-rows");
$headers.addClass("grid-headers");
$headers.toggle(function (e) {
sortGrid($(this), 0);
}, function (e) {
sortGrid($(this), 1);
});
function sortGrid(row, direction) {
var colIndex = $(row).parent().children().index($(row));
var $rowsArray = $.makeArray($rows);
var $sortedArray = $rowsArray.sort(function (o, n) {
var $currentCell = $("td:nth-child(" + (colIndex + 1) + ")", $(o));
var $nextCell = $("td:nth-child(" + (colIndex + 1) + ")", $(n));
var currentValue = parseFloat($currentCell.text()) ? parseFloat($currentCell.text()) : $currentCell.text();
var nextValue = parseFloat($nextCell.text()) ? parseFloat($nextCell.text()) : $nextCell.text();
if (direction == 0) {
return currentValue < nextValue ? -1 : 1;
}
else {
return currentValue > nextValue ? -1 : 1;
}
});
$("> tbody > tr:not(:has(table, th))", $gv).remove();
$("tbody", $gv).append($sortedArray);
}
});
</script>