Hi David,
You have to do it on your own, Here is some code that may help you
PD: I'm using strong typed collection as datasource for my grid, so the code
below WILL NOT COMPILE but it will give you an idea of how to do it
in the aspx file:
grid declaration, take a look as I set to false the paging
<tr><td>
<asp:datagrid id=accidentgrid runat="server" ShowHeader="false"
PagerStyle-Visible="False"
visible="true" showfooter="False" autoGenerateColumns="False"
BackColor="white" CellSpacing="0" GridLines="None" >
</asp:datagrid>
</td></tr>
<tr><td>
<!--
Here is the pagination code, it consist of two LinkButtons whose
properties ( enable) are set dynamically depending of the datasource
-->
<asp:LinkButton OnClick="GotoPreviousPage" CssClass="purple"
Enabled="<%#ExistPreviousPage() %>" id=LinkButton1 runat="server">
<- Prev</asp:LinkButton>
<asp:LinkButton OnClick="GotoNextPage" CssClass="purple"
Enabled="<%#ExistNextPagePage() %>" id="Linkbutton2"
runat="server">Next -> </asp:LinkButton>
</td></tr>
Now in the code behind I define the function used to know the paging and do
the pagination itself.:
Code behind code:
protected bool ExistPreviousPage()
{
return accidentgrid.CurrentPageIndex>0;
}
protected void GotoPreviousPage(object sender, System.EventArgs e)
{
accidentgrid.CurrentPageIndex -=1;
GridContainer.DataBind();
}
protected bool ExistNextPagePage()
{
return accidentgrid.CurrentPageIndex< accidentgrid.PageCount-1;
}
protected void GotoNextPage(object sender, System.EventArgs e)
{
accidentgrid.CurrentPageIndex +=1;
GridContainer.DataBind();
}
Hope this help,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"David Petersen" <da*******@hotmail.com> wrote in message
news:uz**************@TK2MSFTNGP12.phx.gbl...
I need to change the paging buttons in my C# web datagrid from "previous"
and "next" to something like "Records 10-20 of 100", etc., depending on
which page the user is on. Any ideas?
Thanks,
Dave