title: My Datagrid on PageIndexChanging and on Sorting disappears on me?
body: <p>So I have a Search Page where a user search's for a supplier. All well and done. Now because I am using an entity framework I do not have a dataset bound to the grid. Instead I have these two babies.</p>
  
  <pre><code>  Protected Sub dgdResults_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs) Handles dgdResults.PageIndexChanging
          If Page.IsPostBack Then
              'Do something
              dgdResults.PageIndex = e.NewPageIndex
              dgdResults.DataSource = dt
              dgdResults.DataBind()
          End If
      End Sub
  
      Protected Sub dgdResults_Sorting(sender As [Object], e As GridViewSortEventArgs)
          If Page.IsPostBack Then
              ViewState("sortExpr") = e.SortExpression
              dgdResults.DataSource = dt
              dgdResults.DataBind()
          End If
      End Sub
  </code></pre>
  
  <p>and these two babies are linked to </p>
  
  <pre><code> &lt;asp:GridView ID="dgdResults" runat="server" AutoGenerateColumns="false" OnRowDataBound="OnRowDataBound" OnSelectedIndexChanged="OnSelectedIndexChanged" Width="1900px"
                      GridLines="None" CssClass="grid" HeaderStyle-CssClass="gridHeaderBlue" RowStyle-CssClass="gridRowResult" AlternatingRowStyle-CssClass="gridAltRowResult"
                      AllowSorting="True" AllowPaging="True" OnPageIndexChanging="dgdResults_PageIndexChanging" OnSorting="dgdResults_Sorting"&gt;
                      &lt;Columns&gt;
  </code></pre>
  
  <p>Now saying that when ever I click on a different page or I click on a column header to sort. The entire datagrid disappears. At first I thought it was because my panel was set to visible=false but the panel headers still remain when sorting is triggered or page indexing is triggered its just the datagrid disappears. no errors no nothing? Anyone had an experience with this before? Any fixes? I debugged it thru and thru cannot see any errors.</p>