This is a migrated thread and some comments may be shown as answers.

[Solved] Custom Paging and Sorting in Entity Framework 4

4 Answers 325 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kencox
Top achievements
Rank 1
kencox asked on 01 Aug 2010, 04:09 PM
Hi folks,

Could someone point me to a sample of doing custom (server-side) paging and sorting using RadGrid and Entity Framework 4?

I've seen samples that call a stored procedure but nothing on plain EF4 (VB preferred).

Thanks,

Ken

4 Answers, 1 is accepted

Sort by
0
improwise
Top achievements
Rank 1
Iron
Iron
answered on 02 Aug 2010, 02:24 AM
Actually, it depends on how you are using EF4, are you using the EntityDataSource or making a "real" application with Business Layer etc? If you are using EntityDataSouce, paging and sorting is done for you and works very well with RadGrid etc, but its mor tricky if you use ObjectDataSource or similar (which of course has many other great advantages).
0
kencox
Top achievements
Rank 1
answered on 02 Aug 2010, 02:46 AM
Hi Patrik,

Thanks for your response.

I used the EntityDataSource for quick development but RadGrid appears to fetch all the data and then do the filtering and sorting on the client. That's suitable for a small amount of data but not for a huge number of rows.

There's a useful example in the Code Library called True Custom Paging and Sorting. I'm trying to do the same thing strictly in Entity Framework 4. (That is, without the use of the SQL stored procedure and DataTable.)

I've been making progress on reproducing this functionality on my own, but I had hoped someone had already invented this wheel using EF4.

Ken
0
Nikolay Rusev
Telerik team
answered on 05 Aug 2010, 08:41 AM
Hello Ken,

If you are using EntityDataSource RadGrid will apply all filtering/sorting/paging on the data source and only PageSize items will be returned to server. For your convenience I've prepared sample demonstrating RadGrid binding to EntityDataSource with paging/sorting/filter. If you perform one of those operations Label will be updated with Count of the records returned to RadGrid.

Regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Satish
Top achievements
Rank 1
answered on 17 May 2013, 09:16 AM
yy
Tags
Grid
Asked by
kencox
Top achievements
Rank 1
Answers by
improwise
Top achievements
Rank 1
Iron
Iron
kencox
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Satish
Top achievements
Rank 1
Share this question
or