views:

1306

answers:

1

I currently have a repeater whose datasource is a List where ModelObject is a custom class in the front-end used to help render the more complex LINQ to SQL object. For example, it renders URLS for links, names of statuses, etc.. The status names are not in the database because we knew we'd have to localize this app someday.

Now I need to page and sort this list so I'm trying to switch to a gridview to take advantage of the out of the box functionality. I get the error "The data source does not support server-side data paging". What kind of datasource can I use that will still allow my front-end to customize the output? This seems it should be a common task because apps that are localized need the sort values coming out of the resx files.

Thanks for your help.

+3  A: 

You can't use an IQueryable object to data bind to a GridView and still use Paging and Sorting. You must return a List to the GridView using the ToList() method.

See this DevToolShed Article for more information:
http://www.devtoolshed.com/content/gridview-objectdatasource-linq-paging-and-sorting

Robert Harvey
This link is helping. First thing I had to do is change the datasource from IEnumerable to IList. I think I'll have to work more with a custom ObjectDataSource, but again, this link covers that.
Mark