1
I am building an Asp.net application using Entity framwork. To load the grid I use the following instructions:
var lista = entity.Usuario.ToList().OrderBy(x=>x.nome);
grid.DataSource = lista;
grid.DataBind();
But when I try to configure paging on the grid the following error appears:
[Notsupportedexception: The data source does not support server data paging.]
System.Web.UI.DataSourceView.Raiseunsupportedcapabilityerror(Datasourcecapabilities Capability) +2875489
System.Web.UI.DataSourceSelectArguments.Raiseunsupportedcapabilitieserror(Datasourceview view) +62
System.Web.UI.WebControls.Readonlydatasourceview.Executeselect(Datasourceselectarguments Arguments) +17
System.Web.UI.DataSourceView.Select(Datasourceselectarguments Arguments, Datasourceviewselectcallback callback) +22
System.Web.UI.WebControls.Gridview.Createchildcontrols(Ienumerable datasource, Boolean dataBinding) +367
System.Web.UI.WebControls.Compositedataboundcontrol.Performdatabinding(Ienumerable date) +67
System.Web.UI.WebControls.Gridview.Performdatabinding(Ienumerable date) +14
System.Web.UI.WebControls.Databoundcontrol.Ondatasourceviewselectcallback(Ienumerable date) +128
System.Web.UI.DataSourceView.Select(Datasourceselectarguments Arguments, Datasourceviewselectcallback callback) +34
System.Web.UI.WebControls.Databoundcontrol.Performselect() +143
System.Web.UI.WebControls.Basedataboundcontrol.Databind() +74
System.Web.UI.WebControls.Gridview.Databind() +9
Refeitorio.paginas.Cadusuariosaspx.carregarGrid() in C: Users sv111727 Source Redoubt Redoubt Redoubt pages Cadusuariosaspx.aspx.Cs:55 Refeitorio.paginas.Cadusuariosaspx.Page_load(Object Sender, Eventargs e) in C: Users sv111727 Source Redoubt Redoubt Redoubt pages Cadusuariosaspx.aspx.Cs:16 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object Sender, Eventargs e) +51 System.Web.UI.Control.Onload(Eventargs e) +95
System.Web.UI.Control.Loadrecursive() +59
System.Web.UI.Page.Processrequestmain(Boolean includedStagesBeforeAsyncPoint, Boolean includedStagesAfterAsyncPoint) +780
Does anyone know how to solve this problem?
tested the suggestion made in my reply?
– Leandro Angelo
A "silly" error, the author never came back to see the answer and do not believe it can be very useful to other users.
– Leandro Angelo