this.DataGrid1.DataSource = ds;
if((DataGrid1.CurrentPageIndex==DataGrid1.PageCount-1)&&DataGrid1.Items.Count==1)
{
if(DataGrid1.CurrentPageIndex-1>=1)
{
DataGrid1.CurrentPageIndex = DataGrid1.CurrentPageIndex-1;
}
else
{
DataGrid1.CurrentPageIndex = 0;
}
}
this.DataGrid1.DataBind();
if((DataGrid1.CurrentPageIndex==DataGrid1.PageCount-1)&&DataGrid1.Items.Count==1)
{
if(DataGrid1.CurrentPageIndex-1>=1)
{
DataGrid1.CurrentPageIndex = DataGrid1.CurrentPageIndex-1;
}
else
{
DataGrid1.CurrentPageIndex = 0;
}
}
this.DataGrid1.DataBind();