if(dg.CurrentPageIndex == dg.PageCount-1)
 {
//如果就只有一页
if(dg.CurrentPageIndex == 0)
 {
//删除后页面停在当前页
dg.CurrentPageIndex = dg.PageCount-1;
}
else
 {
//如果最后一页只有一条记录
if((dg.Items.Count % dg.PageSize == 1) || dg.PageSize == 1)
 {
//把最后一页最后一条记录删除后,页面应跳转到前一页
int_PageLess = 2;
}
else //如果最后一页的记录数大于1,那么在最后一页删除记录后仍然停在当前页
 {
int_PageLess = 1;
}
dg.CurrentPageIndex = dg.PageCount - int_PageLess;
}
}
}
上一页 [1] [2] |