title: Gridview Paging
body: <p>I've got a gridview that is bound to a dataview in the codebehind. The datasource is actually powershell, so I'm processing the data myself. This works fine and displays the result how I want. 
  However, when I try to enable paging, I get this error when opening the page:</p>
  
  <p>The table  must contain row sections in order of header, body, then footer.</p>
  
  <p>Any idea why this is happening?</p>
  
  <p>Heres the code for my binding:</p>
  
  <pre><code>      mbGrid.DataSource = MailBoxManager.Instance.getDataTable();
        mbGrid.EnableSortingAndPagingCallbacks = true;
        mbGrid.AllowPaging = true;
  </code></pre>
  
  <p>And the code that populates the datatable is:</p>
  
  <pre><code>public DataTable getDataTable()
      {
          DataTable dt = new DataTable();
          dt.Columns.Add(new DataColumn("Name", typeof(string)));
          dt.Columns.Add(new DataColumn("Email", typeof(string)));
  
          foreach (Mailbox mb in MbList)
          {
              DataRow dr;
              dr = dt.NewRow();
              dr["Name"] = mb.Name;
              dr["Email"] = mb.PrimaryEmail;
              dt.Rows.Add(dr);
          }
          return dt;
      }
  </code></pre>