all groups > dotnet general > june 2003 >
You're in the

dotnet general

group:

Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount


Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount Meg
6/30/2003 2:34:30 PM
dotnet general:
Hi All,

I am having a problem with paging in datagrid and need
some idea as to how to handle the problem
1. the datagrid is first filled with a select * all
2. the datgrid shows 10 pages 12345678910
3. the first page shows 10 records
4. if do a keyword search on the full dataset the selected
records are returned...I can repeat this many times while
my page index is set to page 1.
5. I can also repeat the select all and the above steps
still work (page index is set to page 1)
6. If I move off of page 1 to another page like say page 5.
page 5 and it's records work
7. if I do a select * all the page count stays at page 5
(most likely because of the !postback in page load)
8. I if I do a keyword search and I am not set to page 1 I
get the error message "Invalid CurrentPageIndex value. It
must be >= 0 and < the PageCount".
9. how can I initiallize the dataset back to page 1
programmicaly?

Any help is greatly appreciated.

Re: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount Meg
6/30/2003 2:58:32 PM
Yes I did. But I still get the same error.

[quoted text, click to view]
Re: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount Kevin Cunningham
6/30/2003 4:44:46 PM
Did u try to set dataGrid.CurrentPageIndex = 1. The internals of the
datagrid should work out the details for you, assuming you have a valid data
source.

--
Kevin Cunningham
Software Architects


[quoted text, click to view]

Re: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount Kevin Cunningham
6/30/2003 4:57:30 PM
ooops, sorry the CurrentPageIndex is zero-base ... dataGrid.CurrentPageIndex
= 0.

--
Kevin Cunningham
Software Architects


[quoted text, click to view]

AddThis Social Bookmark Button