title: Length of colnames <> colmodel when using dynamic colNames & colModel
body: <p>In my mvc <strong>jqgrid</strong> code, colnames and colmodel returning same length of col. but when run the application im getting this error. Any help? </p>
  
  <p>Code :</p>
  
  <pre><code>public WeekColumns GetWeekColumns(DateTime start, DateTime end)
      {
          WeekColumns week = new WeekColumns();
  
          string sWeekDate = string.Empty;
  
          var model = db.GetWeek(start.ToString("MM/dd/yyyy"),
              end.ToString("MM/dd/yyyy")).ToList().Select(s =&gt; s.WeekDate.ToString());
  
          IEnumerable&lt;string&gt; sModel = new List&lt;string&gt;();
          sModel = model;
  
          string sColumnNames = "['ID', 'Account', 'Lob'";
  
          foreach (string item in sModel)
              sColumnNames += ", 'C" + item.ToString().Replace("/", "_").Trim() + "'";
  
          sColumnNames += ", 'Report']";
  
          string sColumnModels = "[{ name: 'ID', key: true, hidden: true }, ";
          sColumnModels += "{ name: 'Account', width: 150, align: 'center' }, ";
          sColumnModels += "{ name: 'Lob', width: 150, align: 'center' }";
  
          foreach (string item in sModel)
              sColumnModels += ", { name: 'C" + item.ToString().Replace("/", "_").Trim() + 
                  "', width: 150, editable: true}";
  
          sColumnModels += ", { name: 'Report', width: 150, align: 'center' }]";
  
          week.ColumnName = sColumnNames;
          week.ColumnModel = sColumnModels;
  
          return week;
      }
  </code></pre>
  
  <p>js :</p>
  
  <pre><code>$.ajax({
          url: "Staffing/GetWeekDate",
          type: 'POST',
          dataType: 'json',
          contentType: "application/json",
          cache: false,
          success: function (data) {
              $("#jqTable").jqGrid({
                  // Ajax related configurations
                  url: "Staffing/LOBStaffing",
                  datatype: "json",
                  mtype: "POST",
                  //ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
                  jsonReader: {
                      root: 'rows',
                      page: 'page',
                      total: 'total',
                      records: 'records',
                      repeatitems: true,
                      data: 'data'
                  },
  
                  // Specify the column names
                  colNames: data.ColumnName,
  
                  // Configure the columns
                  colModel: data.ColumnModel,
  
                  // Grid total width and height  
                  width: 900,
                  height: 350,
  
                  sortname: 'Lob',
                  // Paging
                  rowList: [],        // disable page size dropdown
                  pager: $("#jqTablePager"),
                  pgbuttons: false,     // disable page control like next, back button
                  pgtext: null,         // disable pager text like 'Page 0 of 10'
                  viewrecords: true,
                  rowNum: 2000,
  
                  grouping: true,
                  groupingView: {
                      groupField: ['Account', 'Lob'],
                      groupColumnShow: [true, true],
                      groupText: ['&lt;b&gt;{0}&lt;/b&gt;'],
                      groupCollapse: false,
                      groupOrder: ['asc', 'asc'],
                      groupSummary: [true, true]
                  },
  
                  // Grid caption
                  caption: "List of Forms"
              }).navGrid("#jqTablePager",
                  {
                      refresh: true,
                      add: false,
                      edit: false,
                      del: false,
                      search: false,
                      refreshtext: "Refresh",
                      searchtext: "Search"
                  },
                  {}, // settings for edit
                  {}, // settings for add
                  {}, // settings for delete
                  {multipleGroup: true }, // settings for search,
                  {
                  multipleGroup: true,
                  sopt: ["cn", "eq"],
                  caption: "Search",
                  Find: "Search"
              }); // Search options. Some options can be set on column level
  
          },
          error: function () {
              alert('error');
          }
      });
  </code></pre>