Question : when adding Paging VB.Net GridView disappears

GridView id="grid" works without AllowPaging="true"
, but disappears when adding paging set out below:
The complete aspx & vb code as per attached file.
<div style=" position:absolute; width:812px; height:114px; left:-1px; top:204px; font-size:smaller; overflow:auto;  border: 2px solid #722F90; "
    id="DIV6">
<span id="aaaDiv6" style="position:absolute; top:2px; left:450px;"></span>
<!--START PAGE SECTION-->
<asp:GridView ID="grid"
 OnSelectedIndexChanged="grid_SelectedIndexChanged"
 OnPageIndexChanging="grid_PageIndexChanging"
 runat="server"  AutoGenerateColumns="False"
 style="z-index: 100; font-size:xx-small; left: 0px; position: absolute; top: 0px"
 AllowPaging="true"
 PageSize="3">
 <Columns>
 <asp:ButtonField CommandName="Select" Text="Select" />
 <asp:BoundField DataField="rec_ID" HeaderText="rec_ID" />
 <asp:BoundField DataField="Server_Name" HeaderText="Server_Name" />
 <asp:BoundField DataField="Table_Name" HeaderText="Table_Name"  />                                    
  </Columns>
 </asp:GridView>
<!--END PAGE SECTION CODE-->
</div>
Attachments:
 
Gridwiew paging
 

Answer : when adding Paging VB.Net GridView disappears

I can't see the page load event handler, and another problem is not binding the GridView after the post-back.  I see that you are setting the page size to 3, and that you are binding the grid after changing the PageIndex property, which would have been my guess.  The SqlDataSource control automatically coordinates paging with the GridView, but when you handle it manually, it needs to be handled correctly.  I used to do a get from the database on initial page load into a DataTable, and then store that into a session variable that could be retrieved on post-back, so that I didn't have to do a get again.  I never bind a data reader to the GridView, though, so there is another possibility for a problem, since a data reader gives you a forward-only view of the data.  Paging may require a different construct.
Random Solutions  
 
programming4us programming4us