Unplanned
Last Updated: 21 Jan 2020 15:41 by ADMIN
Pablo
Created on: 19 Oct 2016 20:22
Category: Grid
Type: Feature Request
9
Add Page Number to the ASP.NET MVC Grid Helper
In you web site we used the Html.Kendo().Grid Helper to build our code for the grid.
When a user refresh the page we want to keep the context of the grid, meaning the same page size the same sort and the same page number.

When we build the grind using Html.Kendo().Grid Helper the only option that we can not set is the Page number (the page that is being display).

I see that using the javascript we can set the page

<script>
var dataSource = new kendo.data.DataSource({
  data: [
    { name: "Tea", category: "Beverages" },
    { name: "Coffee", category: "Beverages" },
    { name: "Ham", category: "Food" }
  ],
  // set the second page as the current page
  page: 2,
  pageSize: 2
});
dataSource.fetch(function(){
  var view = dataSource.view();
  console.log(view.length); // displays "1"
  console.log(view[0].name); // displays "Ham"
});
</script>

But why this option is not available using the MVC Helper

.DataSource(dataSource => dataSource 
.Ajax().PageSize(24) 
.ServerOperation(true) // Paging, sorting, filtering and grouping will be done client-side 
.Read(read => read.Url("/results/gethomes")) 

This will be a nice feature to have.
Thanks
0 comments