title: Gridview DataSource has rows, but GridView doesn't
body: <p>The first time I load the GridView it's fine.  Then I sort on a column and the GridView comes back with no rows.  The debugger shows that there are rows in the DataSource table, but there are none in the GridView itself.  (Note that I'm creating the GridView dynamically, but that shouldn't matter as far as I know.)</p>
  
  <p>These are the lines of code:</p>
  
  <pre><code>gv.DataSource = dv;    
  gv.DataBind();
  </code></pre>
  
  <p>Nothing special.</p>
  
  <p>These are the values the debugger shows when stepping through the code.</p>
  
  <p>Before the first line:</p>
  
  <pre><code>dv.Table.Rows.Count 23
  
  ((System.Data.DataView)(gv.DataSource)).Table.Rows.Count    '((System.Data.DataView)(((System.Web.UI.WebControls.BaseDataBoundControl)(gv)).DataSource))' is null
  
  gv.Rows.Count   0
  </code></pre>
  
  <p>After the first line:</p>
  
  <pre><code>dv.Table.Rows.Count 23
  
  ((System.Data.DataView)(gv.DataSource)).Table.Rows.Count    23
  
  gv.Rows.Count   0
  </code></pre>
  
  <p>After the second line of code:</p>
  
  <pre><code>dv.Table.Rows.Count 23
  
  ((System.Data.DataView)(gv.DataSource)).Table.Rows.Count    23
  
  gv.Rows.Count   0
  </code></pre>