tags:

views:

190

answers:

1

I need convert to list a object with anonymous type because when i databind the gridview i get

"The data source does not support server-side data paging"

or How i can solve this?

object o =  HttpRuntime.Cache[key];

if(o is ICollection)
{
    //Sort Object
    o = ((IQueryable)this.DataSource).AsQueryable().OrderBy(SortExpresion);

    DataSource = o;

    DataBind();

}

data returned from cache are ok, the problem is that i extended the gridview control and the data type of datasource is always different, and i need sort this anonymous data stored in cache and use in the gridview

A: 

Set the datasource of a PagedDataSource class and then assign this object as the datasource of your gridview. Otherwise, create an object datasource and bind that to your gridview.

Andrew

REA_ANDREW