当前位置: 代码迷 >> ASP.NET >> 怎么在DataGrid中的分页中加入"首页"和"末页"按钮
  详细解决方案

怎么在DataGrid中的分页中加入"首页"和"末页"按钮

热度:7958   发布时间:2013-02-25 00:00:00.0
如何在DataGrid中的分页中加入"首页"和"末页"按钮
一般在DataGrid中只有 "上一页 "和 "下一页 "两个按钮,现在我想再加入 "首页 "和
"末页 "两个按钮要怎么弄
请大家帮帮忙

------解决方案--------------------------------------------------------
自定义分页控件 或者用 吴旗娃的分页控件也行。

------解决方案--------------------------------------------------------
用自定义控件的话,两个事件就能搞定。
以下伪代码仅供参考
protected void btnFirst_Click(object sender, EventArgs e)
{
if (当前页数> 1)
{
当前页改为 = 1;
分页动作;
}
}
protected void btnLast_Click(object sender, EventArgs e)
{
if (当前页序号 < 总页数)
{
当前页改为=总页数;
分页动作;
}
}
------解决方案--------------------------------------------------------
DataGrid不带这功能


My-Blog地址1:http://www.cnblogs.com/nyzfl
My-Blog地址2: http://blog.csdn.net/nyzfl
  相关解决方案