我用DataGrid控件,在做删除记录功能时遇到了一些问题.
比如有两页,6条记录,每页显示5条,也就说显示两页,第一页5条,第二页1条,当我删除第二页的一条记录时报错.说是无效CurrentPageIndex,说CurrentPageIndex必须大于0小于PageCount,试问如何解决此问题.还有如何确定上例中的第二页的第一条记录.小弟在此先谢过了!~~~~
比如有两页,6条记录,每页显示5条,也就说显示两页,第一页5条,第二页1条,当我删除第二页的一条记录时报错.说是无效CurrentPageIndex,说CurrentPageIndex必须大于0小于PageCount,试问如何解决此问题.还有如何确定上例中的第二页的第一条记录.小弟在此先谢过了!~~~~
解决方案 »
- 请教301重定性问题
- Remoting是什么
- 给DataTable添加超链接列问题
- 初学者的几个Web Service问题,谢谢
- 如何让文本框中的文本靠右对齐
- 请帮忙改写成存储过程!成功立马给分!!!!(急急急)
- 请问如何通过javascript在aspx页面将某个TextBox设置为ReadOnly,,,,,,,急
- sourcesafe6.0d有多大,还有就是他的serial nubmer是多少
- 共享数据连接的问题
- 救命,急!Datagrid的分页事件grdQuery_PageIndexChanged为什么触发不了?
- 急,IIS下的.net网站无法打开
- 价值10W的新闻采集源代码提供!可以自动生成HTML(C#开发)
{
DataGrid1.CurrentPageIndex = DataGrid1.CurrentPageIndex -1;
}
{
tggrid.CurrentPageIndex=e.NewPageIndex;
bindtggrid();
}
if (this.DataGrid1.PageCount!=1 && DataGrid1.Items.Count ==1)
{
DataGrid1.CurrentPageIndex = DataGrid1.CurrentPageIndex -1;
}
DataGrid1.CurrentPageIndex = DataGrid1.CurrentPageIndex -1;
DataGrid1.DataBind()方法之后写上这个..
if (this.DataGrid1.PageCount!=1 && DataGrid1.Items.Count < 1)
{
DataGrid1.CurrentPageIndex = DataGrid1.CurrentPageIndex -1;
//这里要重新绑定一次DataGrid..
}