一般在DataGrid中只有"上一页"和"下一页"两个按钮,现在我想再加入"首页"和
"末页"两个按钮要怎么弄
请大家帮帮忙

解决方案 »

  1.   

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

  2.   

    那么要怎样在DataGrid中加上"首页""末页"按钮呢
      

  3.   

    DataGrid不带这功能
    My-Blog地址1:http://www.cnblogs.com/nyzfl
    My-Blog地址2: http://blog.csdn.net/nyzfl