删除时
if(DataGrid1.Items.Count == 1)
if(DataGrid1.CurrentPageIndex > 0)
DataGrid1.CurrentPageIndex = DataGrid1.CurrentPageIndex = 0;
if(DataGrid1.Items.Count == 1)
if(DataGrid1.CurrentPageIndex > 0)
DataGrid1.CurrentPageIndex = DataGrid1.CurrentPageIndex = 0;
解决方案 »
- Asp.net事件委托的简单问题
- 关于mvc的异常拦截器
- 大家有没有好一点的学习ASP.NET的书推荐一下,我现在刚开始学。可以直接带着做项目的。
- ArrayList 如何通过IComparable接口 实现Sort
- 最近看了一些asp.net源码,出现了这样的问题
- 存储过程参数传递问题,好象没有错哦,你认为呢?
- asp.net中调用dll遇到的问题???
- 求无级Treeview生产算法,结合sql的。
- 请教webdiyer(webdiyer),分页控件问题再次请教,请进!
- asp如何实现模糊查询,求助急在线等!!!!!
- 常见问题:如何实现主从表,报表,有请各位大虾,和海波.net----waiting!!!
- 请教报表高手或者星级高手,如何显示一个excel文件,并且删除它
{ int iMaxPage=datatable.Rows.Count/this.DataGrid1.PageSize;
int i=datatable.Rows.Count%this.DataGrid1.PageSize;
if(i!=0)
{
iMaxPage++;
}
if(iMaxPage-1<e.NewPageIndex)
{
this.DataGrid1.CurrentPageIndex=iMaxPage-1;
}
else
{
this.DataGrid1.CurrentPageIndex=e.NewPageIndex;
}
this.DataGrid1.DataSource=datatable;
this.DataGrid1.DataBind();
}
If DataGrid1.Items.Count = 1 And DataGrid1.CurrentPageIndex > 0 Then
DataGrid1.CurrentPageIndex = DataGrid1.CurrentPageIndex - 1
End If