B
branton ellerbee
Has anyone had this problem:
you are using a datagrid that is populated by a filter. Let say for
arguments sake, it is a list of clients. And you narrow the list with the
alphabet using a dropdown or textbox. Either one makes no difference in this
case.
So, you have a dropdown and you jump from "A" to "J", and it brings back all
of the clients whose names begin with "J". Let say it returns 15 pages of
clients that have the name "J". Let say you want someone on the 12th page,
so you navigate there. Everything is fine.
Then you need to go to the letter "B" next, so select "B" out of the
dropdown and you get this error:
Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Invalid CurrentPageIndex value.
It must be >= 0 and < the PageCount.
What is happening is that "B" doesn't have 15 pages of records, I realize
this. And because I was on page 12, there is no page 12 for the letter "B".
The recordset for "B" returns 6 pages of clients , etc...
To solve the problem, obviously, one needs to set the CurrentPageIndex = 0,
but this doesn't seem to work, and I don't know why. No matter where you try
to set the currentpageindex to zero, the datagrid seems to fire before that
code executes.
So does anyone know why this doesn't work and what needs to be done to fix
it?
you are using a datagrid that is populated by a filter. Let say for
arguments sake, it is a list of clients. And you narrow the list with the
alphabet using a dropdown or textbox. Either one makes no difference in this
case.
So, you have a dropdown and you jump from "A" to "J", and it brings back all
of the clients whose names begin with "J". Let say it returns 15 pages of
clients that have the name "J". Let say you want someone on the 12th page,
so you navigate there. Everything is fine.
Then you need to go to the letter "B" next, so select "B" out of the
dropdown and you get this error:
Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Invalid CurrentPageIndex value.
It must be >= 0 and < the PageCount.
What is happening is that "B" doesn't have 15 pages of records, I realize
this. And because I was on page 12, there is no page 12 for the letter "B".
The recordset for "B" returns 6 pages of clients , etc...
To solve the problem, obviously, one needs to set the CurrentPageIndex = 0,
but this doesn't seem to work, and I don't know why. No matter where you try
to set the currentpageindex to zero, the datagrid seems to fire before that
code executes.
So does anyone know why this doesn't work and what needs to be done to fix
it?