Invalid currentPageIndex error message

G

Guest

Hello -

I have a datagrid and a dropdownlist (which is outside the datagrid). When
I click on a category in the dropdownlist, the datagrid changes to correspond
to that category. The datagrid is paged. If the pager is not on the first
page, I receive the following error: "Invalid currentPageIndex value. It
must be >= 0 and < PageCount." What do I have to put in my code to "set" the
pager to the value it has on the first page?

Any help will be greatly appreciated!
 
B

Brock Allen

If you change the rows to be shown in the DataGrid (via a filter, say) and
the previous page index is now out of bounds, you need to recalculate (or
simply set to zero) a new current page index.
 
G

Guest

Thanks so much, Brock!

This is a real "duh." I can't believe I didn't even really read the error
message. My first inclination was to try to set it to 1 (for what reason, I
don't know) and then to panic. Guess I need a little sleep!

Thanks again.

Sandy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top