Hi all,
I am struggling with binding some entities from the Entity Framework 6.0 to the RadGrid.
The solution contains an Entity Framework 6.1.1 Code First Migrations project in which I have a DBContext which contains several DBSets. A DBSet is just a set of POCO classes.
Now comes the struggle... How to bind it with a RadGrid inside an ASP.NET project. I already tried some things which I found in the demo`s forums and other internet posts.
I tried it with the EntityDataSource but this one only uses a ObjectContext instead of a DBContext. I know there is a NuGetPackage which contains an updated EntityDataSource and need to test this.
I also tried connecting the DBSet directly to the datasource property of the datagrid by using the NeedDataSource event. In this case I get an error on loading the web page: Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery, DbRawSqlQuery) is not supported......For ASP.NET WebForms you can bind to the result of calling ToList() on the query or use Model Binding.
When I try to do as described in the above error and call the ToList() method on the DBSet the page is rendered correctly but all things like sorting, filtering, paging, etc are not working.
Can someone please help me on this and give me some advice how to bind the RadGrid to the Entity Framework 6.1.1 entities so the sorting, filtering, grouping, paging, etc is working out of the box?
Beside the above functionality I also need CRUD operations. I guess this has to be implemented through code and will not come Out Of the Box?
Thank you all in advance!!!
I am struggling with binding some entities from the Entity Framework 6.0 to the RadGrid.
The solution contains an Entity Framework 6.1.1 Code First Migrations project in which I have a DBContext which contains several DBSets. A DBSet is just a set of POCO classes.
Now comes the struggle... How to bind it with a RadGrid inside an ASP.NET project. I already tried some things which I found in the demo`s forums and other internet posts.
I tried it with the EntityDataSource but this one only uses a ObjectContext instead of a DBContext. I know there is a NuGetPackage which contains an updated EntityDataSource and need to test this.
I also tried connecting the DBSet directly to the datasource property of the datagrid by using the NeedDataSource event. In this case I get an error on loading the web page: Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery, DbRawSqlQuery) is not supported......For ASP.NET WebForms you can bind to the result of calling ToList() on the query or use Model Binding.
When I try to do as described in the above error and call the ToList() method on the DBSet the page is rendered correctly but all things like sorting, filtering, paging, etc are not working.
Can someone please help me on this and give me some advice how to bind the RadGrid to the Entity Framework 6.1.1 entities so the sorting, filtering, grouping, paging, etc is working out of the box?
Beside the above functionality I also need CRUD operations. I guess this has to be implemented through code and will not come Out Of the Box?
Thank you all in advance!!!