470,591 Members | 2,005 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

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

Meg
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.

Meg
Jul 19 '05 #1
3 14323
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
"Meg" <me****@yahoo.com> wrote in message
news:28****************************@phx.gbl...
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.

Meg

Jul 19 '05 #2
Meg
Yes I did. But I still get the same error.
-----Original Message-----
Did u try to set dataGrid.CurrentPageIndex = 1. The internals of thedatagrid should work out the details for you, assuming you have a valid datasource.

--
Kevin Cunningham
Software Architects
"Meg" <me****@yahoo.com> wrote in message
news:28****************************@phx.gbl...
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.

Meg

.

Jul 19 '05 #3
ooops, sorry the CurrentPageIndex is zero-base ... dataGrid.CurrentPageIndex
= 0.

--
Kevin Cunningham
Software Architects
"Kevin Cunningham" <kcunningham@sarkDtown> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl...
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
"Meg" <me****@yahoo.com> wrote in message
news:28****************************@phx.gbl...
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.

Meg


Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by jm | last post: by
2 posts views Thread by Sandy | last post: by
3 posts views Thread by JackO | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.