"Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount" Problem Still Error

  • Thread starter Thread starter Kelvin
  • Start date Start date
K

Kelvin

Hi All,

I try to use the following microsft resolution web site, but still
have same problem.

http://support.microsoft.com/default.aspx?scid=kb;en-us;555074

I put the source code on "DataGrid_setPage"

try
{
//bind code
CheckOrder (null,null ); <---- Binding Function
}
catch(ArgumentOutOfRangeException)
{
datagrid1.currentpageindex = 0;
CheckOrder (null,null ); <---- Binding Function
//re-bind code
}

I also try to modify above code, I can't change pages. Pleasd advise.
 
Kelvin,

In your sample you have…

//bind code
CheckOrder (null,null ); <---- Binding Function

in the try. Then you have reversed the order in the catch…

CheckOrder (null,null ); <---- Binding Function
//re-bind code

Have you tried to put these in the same order? If this does not work I
would suggest that you disable view state for the datagrid. That seems to be
the safest all around method.

I hope this helps.
 
Back
Top