S
Simon
Guys,
I have a datagrid that has paging, with the below code.
It _used_ to work, but now doesn't. No idea why.
However, if I put code breaks on the lines indicated with
*, I get the following results:
..DataBind: PageCount = 16, CurrentPageIndex = 2
..Write: PageCount = 1, CurrentPageIndex = 2
So, calling databind results in 15 pages disappearing, and
then this error:
"Invalid CurrentPageIndex value. It must be >= 0 and < the
PageCount."
Any ideas?
Simon.
private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
System.Data.DataView dvData =
(System.Data.DataView)Session["myData"];
DataGrid1.DataSource = dvData ;
DataGrid1.CurrentPageIndex = e.NewPageIndex;
try
{
* DataGrid1.DataBind();
}
catch
{
* Response.Write("error");
}
}
I have a datagrid that has paging, with the below code.
It _used_ to work, but now doesn't. No idea why.
However, if I put code breaks on the lines indicated with
*, I get the following results:
..DataBind: PageCount = 16, CurrentPageIndex = 2
..Write: PageCount = 1, CurrentPageIndex = 2
So, calling databind results in 15 pages disappearing, and
then this error:
"Invalid CurrentPageIndex value. It must be >= 0 and < the
PageCount."
Any ideas?
Simon.
private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
System.Data.DataView dvData =
(System.Data.DataView)Session["myData"];
DataGrid1.DataSource = dvData ;
DataGrid1.CurrentPageIndex = e.NewPageIndex;
try
{
* DataGrid1.DataBind();
}
catch
{
* Response.Write("error");
}
}