how do i make my grdivew page more dynamic than hardcoded upto 5 pages?, below code works fine but the limitation is that i can show upto 5 pages because i have 5 linkbutons. how can i make this code more dynamic page numbers?
<asp:GridView ID="gvTable" runat="server" ShowHeader="true"
PageSize="5" AllowPaging="true" AllowSorting="true"
DataSourceID="myLinqDataSource" AutoGenerateColumns="false"
OnRowDataBound="GridView_DataBound">
<Columns>
<asp:BoundField DataField="Edited" HeaderText="Date" DataFormatString="{0:d}" />
<asp:BoundField DataField="Activity" HeaderText="Notes" />
</Columns>
<PagerTemplate>
<div style="float: left; margin-left: 7px; line-height: 22px;">
<div style="float: left;">
<asp:ImageButton CommandName="Page" CommandArgument="First" ToolTip="First Page"
runat="server" ID="PagerFirstButton" />
<asp:ImageButton ID="PagerPrevButton" CommandName="Page" CommandArgument="Prev" ToolTip="Previous Page"
runat="server" />
</div>
<div style="float: left;">
<div class="pagerNumber">
<asp:LinkButton runat="server" ID="NumericPager1" CommandArgument="1" Text="1" CommandName="Page" />
</div>
<div class="pagerNumber">
<asp:LinkButton runat="server" ID="NumericPager2" CommandArgument="2" Text="2" CommandName="Page" />
</div>
<div class="pagerNumber">
<asp:LinkButton runat="server" ID="NumericPager3" CommandArgument="3" Text="3" CommandName="Page" />
</div>
<div class="pagerNumber">
<asp:LinkButton runat="server" ID="NumericPager4" CommandArgument="4" Text="4" CommandName="Page" />
</div>
<div class="pagerNumber">
<asp:LinkButton runat="server" ID="NumericPager5" CommandArgument="5" Text="5" CommandName="Page" />
</div>
</div>
<div style="float: left;">
<asp:ImageButton ID="PagerNextButton" CommandName="Page" CommandArgument="Next" ToolTip="Next Page"
runat="server" />
<asp:ImageButton ID="PagerLastButton" CommandName="Page" CommandArgument="Last" ToolTip="Last Page"
runat="server" />
</div>
</div>
<div style="float: left; margin-left: 12px;">
<div style="float: left; margin: 4px 6px 0px 0px;">
Page Size</div>
</div>
<div class="gridCount" runat="server" id="divGridCount">
<b>1</b> Items Found </div>
</PagerTemplate>
</asp:GridView>