在控件的ItemCreated事件中写if (e.Item.ItemType == ListItemType.Pager)
{
e.Item.Cells[0].Controls.Add(new LiteralControl(" 总共" + yourGrid.PageCount + "页"));
}
{
e.Item.Cells[0].Controls.Add(new LiteralControl(" 总共" + yourGrid.PageCount + "页"));
}
<td width="539" height="25" valign="middle" class="bottom">
当前第<font color=red><%=dg.CurrentPageIndex+1%></font>页|
共<font color=red><%=dg.PageCount%></font>页|每页<font color=red><%=dg.pagesize%></font>笔
</td>
</tr><asp:datagrid id="dg"></datagrid>
CurrentPage 当前页
TotalPages 总页数CurrentPage.InnerHtml=(dgThreads.CurrentPageIndex+1).ToString();
TotalPages.InnerHtml=(dgThreads.PageCount).ToString();