title: How to get sord,sidx,page,rows,_serach values to controller
body: <p>I getting null values for the fields sord, sidx,page,rows,_serach etc from JQ Grid while calling controller. I have posted my code.I need to do server side coding for sort,search and to set the rownum count dynamically.Any help would be appreciated.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function displayGrid() {
          $("#JQGridServerSideTable").jqGrid({
               width: 750,
              height: '100%',
              url: '@Url.Action("ServerSideJqGridProcessing", "JQGridHome")',
              datatype: 'json',
              mtype: "GET",
              colNames:  ["Application ID", "TenantId", "Application Name"],
              colModel: [
              { name: 'AppId', index: 'AppId', hidden: false },
              { name: 'TenantId', index: 'TenantId', resizable: true, align: 'center', title: false, editable: true, sortable: true, searchoptions: { sopt: ['eq', 'ne', 'le', 'lt', 'gt', 'ge'] }, searchtype: "number",editrules: {required: true, number: true} },
              { name: 'AppName', index: 'AppName', sortable: true, editable: true,editrules: {required: true} },
              ],  
              rowNum: 10,
              rowList: [5, 10, 20, 30],
              pager: '#JQGridServerSidePaging',
              viewrecords: true,
              caption: "Application List Details",
              sortname: "TenantId",
              sortorder: "asc",
              hoverrows: true,
              altRows:true,
              altclass:'myAltRowClass',
              hidegrid: true,
              toppager: false,
              multiselect: false,
              shrinkToFit: true,
              emptyrecords: "No records to view",
              loadtext:'Loading Data please wait ...'
  
          });
          $("#JQGridServerSideTable").jqGrid('navGrid', '#JQGridServerSidePaging',
               {
                  refresh: false, add: false, edit: false, del: false, search: true,
                  searchtext: "Search",
               },
               {},
               {},{},
  
               {
                sopt: ['eq', 'cn', 'lt', 'le', 'bw', 'bn', 'in'], closeOnEscape: true, multipleSearch: true, overlay: true, width: 460, closeAfterSearch: true }
           );
      }
  
      $(document).ready(function () {
          displayGrid();
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public ActionResult ServerSideJqGridProcessing(string sidx, string sord, int page, int rows, bool _search, string searchField, string searchOper, string searchString)
  {
       AllApps o = new AllApps();
       ApplicationModel appModelObj = new ApplicationModel();
       List&lt;AppList&gt; groups = o.getAllAppList();
       List&lt;AppList&gt; result = null;
       if (_search)
       {
           result = groups.Where(x =&gt; x.AppName.Contains(searchString)).ToList();
       }
       else
       {
           result = groups.Skip(page * rows).Take(rows).ToList();
       }
       int i = 1;
       var jsonData = new { 
           total = groups.Count,
           page = page,
           records = groups.Count,
           rows = (from appgroup in result
                   select new {
                       i=i++,
                       cell = new string[]{appgroup.AppName,appgroup.AppId.ToString(),appgroup.TenantId.ToString()}
                   }).ToArray()
       };
       int TotalCount = appModelObj.AllApplicationList.Count;
       return Json(jsonData);
  }
  </code></pre>