DataGrid中删除最后一页的记录时出错的解决办法!
1 int DataCount = dtLoadLog1.Rows.Count;
2 if(DataCount==0)
3 {
4 dg_log.CurrentPageIndex=0;
5 }
6 else
7 {
8 int i=DataCount % dg_log.PageSize;
9 if(i==0)
10 {
11 dg_log.CurrentPageIndex=dg_log.PageCount-2;
12
13 }
14
15 }