Telerik MVC grid paging bringing back a certain number of records at a time
I am using the latest version of Telerik MVC extensions, ASP.NET MVC 3 with the Razor view engine. I am using entiry framework 4.1 code first with no stored procedures.
I worked through the example at http://demos.telerik.com/aspnet-mvc/grid/paging and I'm not sure if this is what I am looking for.
I am trying to implement paging. The amount of rows on my grid is 50. When 开发者_如何转开发the grid loads for the first time it must do a database table call and fetch the first 50 records. When you go to the next 50 rows, then it must return the next set of 50 records.
The sample ueses view data, I'm not comfortable using view data. It's not safe? Isn't there a decent example to be used on the net?
Also, if I have loaded the first 50 records, and I go to the next page, is there a way of caching the previous records so that it is there?
Implementing a caching solution for Entity framework is completely your own choice, it is definitely possible although I'm becoming less convinced of the value in doing this.
You don't need to use ViewData to provide data to the Telerik grid and one of the huge bonuses of using their grid is that if you have an IQueryable<T>
data source it will automagically provide paging, sorting, filtering functionality straight out of the box.
You didn't state if you are using server or client binding, so i haven't attempted to write any code.
Sounds like you might be using server-side binding though.
精彩评论