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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top