Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an objectdatasource connected do a GridView allowing paging. I have setup the GetRecordset() method of the business class to accept maximumRows and startRowIndex. I have also defined a method to return the total rowcount.

The GridView displays the first 10 records (page size is set to 10) fine. It even shows the total pages below the grid which calculates correctly based on the total rowcount.

The problem happens when I click the page 2 link below the GridView. When I do that, the gridview returns zero rows and the message shows "You are viewing page 1 of 0."

Any ideas why this may be happening. I've searched for solutions and found none and I've tried several different things. I also tried trapping the "PageIndexChanging" event and looking at the e.NewPageIndex value. It shows the correct page number (zero based) but the GetRecordset() method of the business class is never called.

Any helps or advice would be greatly appreciated!
Posted

Okay, hold the fort! Seems like there was an issue with my Business Logic. My paging code was fine!

Works fine now that I fixed the BL!
 
Share this answer
 
Comments
thatraja 8-Apr-11 23:41pm    
Glad you have solved the issue yourself. BTW include the issue details(with code if possible) in your answer. It will help other members with same issue.
Anyway Take a 5!
Can't remember exactly what the problem was but it had to do with the Class that was returning the dataset to the ObjectDatasource. I was trapping the error but doing nothing with it so it just sort of skipped along.

I wish I could remember exactly what I did to correct it. Next time I'll post the solution.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900