simple view with objectContainerDataSource

Topics: Web Client Software Factory, User Forum
Nov 1, 2007 at 3:01 AM
hi, i have a problem in displaying data using gridview and objectcontainerdatasource.

when using the gridview paging , it seems like only first page data is loaded.

this cause an error when we want to go the second page..

it says Specific argument was out of the range of valid values

Did i miss to set some value ?

Please help.
Nov 1, 2007 at 6:32 AM
Edited Nov 1, 2007 at 6:34 AM
It depends on how you use the ObjectContainerDataSource. Basically, you have two options. The first option provides the most amount of flexibility and requires you to attach an event handler to the data source control's Select event. Whenever it needs to get a page of data (because your grid needs it), it will raise the Select event indicating the start index and sorting expression. You need to get the requested (sorted) page from the presenter and pass it back to the data source control. The other option is to pass the entire list of data to the data source control upon each page load. In that scenario, the data source control will do the paging and (basic) sorting for you. So make sure you're using one of those option and not accidentelly mixing aspects of both.

Hth,

Dennis Doomen
Aviva Solutions
Nov 1, 2007 at 7:46 AM
dennis thanks for the response.. i use the simple approach, but i think what i missed is to pass the entire list of data upon each page load.. thanks.
Jun 20, 2008 at 3:50 PM
I'm having the same issue.  The simple option is fine.  I have the gridview datasource as the OCDS and paging turned on.  Well call a public method that returns an IList of the items for binding.  Should that be on the ONViewLoaded instead? 

Also I have an edit button in the gridvew that goes to another page to edit the details.  I had a datakeynames field set in the gridview, but now get an error saying it is not part of the columns.  I need to know the ID of the row clicked.  Is there another way to do this?