mmalling
July 23rd, 2003, 11:03 PM
Can anyone tell me why I'm getting an invalid CurrentPageIndex error wit htis code ?
(This code comes from my PageIndexChanged event handler)
private void dgAvailablePlayers_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
int Index=e.NewPageIndex;
int MaxPages=dgAvailablePlayers.PageCount;
if(Index<0 || Index>=MaxPages)
return;
FillPlayers(QueryString);
CurPageIndex=Index;
dgAvailablePlayers.CurrentPageIndex=Index;
dgAvailablePlayers.DataBind();
}
This does not happen all the time, but most of the time. I'll load the page and it will be fine. Then I'll close the page and load it again and get the error. Sometimes i load the page and its fine then click on a Page number at the bottom and get the error...
It totally appears to be random and its driving me crazy...
(This code comes from my PageIndexChanged event handler)
private void dgAvailablePlayers_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
int Index=e.NewPageIndex;
int MaxPages=dgAvailablePlayers.PageCount;
if(Index<0 || Index>=MaxPages)
return;
FillPlayers(QueryString);
CurPageIndex=Index;
dgAvailablePlayers.CurrentPageIndex=Index;
dgAvailablePlayers.DataBind();
}
This does not happen all the time, but most of the time. I'll load the page and it will be fine. Then I'll close the page and load it again and get the error. Sometimes i load the page and its fine then click on a Page number at the bottom and get the error...
It totally appears to be random and its driving me crazy...