代码较多较乱,看起来麻烦,调试一下,看点下一页的时候有没有运行到你最后那句DataGrid1.DataBind()
解决方案 »
- C# 代码如何实现 获取临时Ipv6地址
- 大家好,关于在一个容器中MediaElement视频播放时,拖放到另一容器 视频不继续播 的问题
- 文件名无效,请检查数据库的文件名
- 嵌套用户控件中第二层的用户控件事件无法相应,怎么解决。
- 求助:valuechanged事件和selectedvaluechanged事件
- 刚学C#,想用它做个俄罗斯方块,大家给点意见.
- c# 调用c++DLL 结构体参数传值的问题
- C#中数字字符串转换成int类型的问题
- 得到本机的IP和密码的语句该怎么写
- 有人研究过如何在datagrid里面如何使用dataset更新数据库吗?
- 如何得到一个DataTable的复杂条件查询的DataView(例如:group by。。)(在线)
- 关联DataGrid的数据显示问题
你可以参照下面的代码//获得LinkButton的参数值
string arg = ((ImageButton)sender).CommandArgument;
switch(arg)
{
case ("next")://下一页
if (this.DataGrid1.CurrentPageIndex < (this.DataGrid1.PageCount - 1))
this.DataGrid1.CurrentPageIndex ++;
break;
case ("prev")://上一页
if (this.DataGrid1.CurrentPageIndex > 0)
this.DataGrid1.CurrentPageIndex --;
break;
case ("last")://最后一页
this.DataGrid1.CurrentPageIndex = (this.DataGrid1.PageCount - 1);
break;
case("first")://第一页
this.DataGrid1.CurrentPageIndex =0;
break;
}
this.InitSelectTotal();//绑定所有数据