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

G

George Smith

In a data grid when the user clicks the "Next" or "Previous" navigational
links I am getting the above error message.

That happens only in the following scenarios.

1.. I am listing all the search results in the grid.
2.. User clicks the next button. Next set of result will be displayed.
3.. User clicks the hyperlink on the grid cell. Take the user to a
different page.
4.. User clicks the browser back button.
5.. Clicks the "Next" button on the grid.
6.. The above error occurs.
The search result gird has more than 100 pages. What I am saying is the
currentPageIndex I am setting here is with in the range as specified in the
error message.

Why I am getting the above error. How to resolve it?

I am on .Net Framework 1.1.

Thanks,

Smith
 
S

sabiha sonaseth

before Binding Data to grid

write

this.datagrid1.currentpageindex = 0


i used this and my problem was solved.
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top