title: JQGrid Sorting is not working - MVC3
body: <p>I am trying to sort the each columns in my JQGrid but its not working. Please refer my code below and help me</p>
  
  <p>//View Code</p>
  
  <pre><code>     $("#JQGridID").jqGrid({
                              url: '/Control/ActionResult/',
                              datatype: 'json',
                              mtype: 'POST',
                              colNames: ['Number', 'Unit'],
                              colModel: [
                { name: 'NNumber', index: 'Number', align: 'left', sortable: true, sorttype: 'int' },
                { name: 'NUnit', index: 'Unit', align: 'Center', sortable: true }
                ],                            pager: jQuery('#pager'),
                              cmTemplate: { title: false },
                              width: widthValue - 15,
                              height: 435,
                              rowNum: 20,
                              rowList: [20, 30, 40, 50, 60],
                              viewrecords: true,
                              gridComplete: loadCompleteFunction,
                              altRows: true,
                              sortorder: 'desc',
                              sortname: 'Number',
                              sortable: true,
                              onSortCol: function (index, idxcol, sortorder) {
                      if (this.p.lastsort &gt;= 0 &amp;&amp; this.p.lastsort !== idxcol
                              &amp;&amp; this.p.colModel[this.p.lastsort].sortable !== false) {
                          $(this.grid.headers[this.p.lastsort].el).find("&gt;div.ui-jqgrid-sortable&gt;span.s-ico").show();
                      }
                  }
  ,
                              onSelectRow: showMessageDetails,
                              postData: {
                          },
  
                          loadError: function (xml) { alert('Unable to load result data.'); }
                      });
  </code></pre>
  
  <p>//Control code</p>
  
  <pre><code> [HttpPost]
          public ActionResult GetSearchPositionResult(string sidx, string sord, int page, int rows)
          {
              _Object = new PositionModel();
              _Object.CurrentPage = page;
              _Object.PageRowCount = rows;
              _Object.load();
              var result = new
              {
                  total = _Object.TotalPages,
                  page = page,
                  sort = sidx,
                  sord = sord,
                  records = _Object.TotalRows,
                              rows = _ObjectPM.SearchResult.Select(p =&gt; new
              {
                  cell = new string[]{
                   p.Number,
                   p.Unit
                  },sidx
              }).OrderBy(a =&gt; a.sidx).ToArray(),                };
              return Json(result, JsonRequestBehavior.AllowGet);
          }
  </code></pre>