Last post Nov 18, 2005 08:30 AM by Jango
Nov 18, 2005 08:30 AM|Jango|LINK
I'm using GridView with ObjectDataSource control to display data. The SelectMethod returns an typed dataset from the business object. I have enabled the paging and sorting feature of the gridview (AllowPaging and AllowSorting set to true). I dont want to use
the paging feature from the ObjectDataSource because I dont want to modify the methods on my business object to accept the startrowindex and maximumrows parameters. I've read that when the business object returns a dataset I can use the paging and sorting
feature from the gridview control.
When I start the application the page loads and displays the first 10 rows in gridview. It also shows the correct number of pages at the bottom of the gridview. When i try to click on a different page number i get an error saying
"The Select operation is not supported by ObjectDataSource 'OrderDataSource' unless the SelectMethod is specified". Both the objectdatasource and the gridview have the EnableViewState set to true. I handle the GridView_PageIndexChanging event
to set the new page index.
I dont understand why I'm getting this error. Can someone please explain what's happening here?
I've also tried using the client side callbacks (EnableSortingAndPagingCallbacks=true) of the gridview control. In this case there's no error, but clicking on a different page still shows the rows from the first page always.
Thanks in advance