Hi,
I created a Grid with Filter Row and using ajax:
@(Html.Kendo().Grid<
Products
>()
.Name("grid")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.ServerOperation(true)
.Model(model => model.Id(p => p.Id))
.Read(read => read.Action("GetList", "CurrentController").Data("HandleFilters")).PageSize(10)
)
.Columns(columns =>
{
columns.Bound(model => model.Name).
Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")).
Operators(m => KendoUICustomLocalization.GridFilterLocalization(m)));
columns.Bound(model => model.LastName).
Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")).
Operators(m => KendoUICustomLocalization.GridFilterLocalization(m)));
})
.Pageable(p => p.Messages(m => KendoUICustomLocalization.GridPageLocalization(m))
.PageSizes(10))
.Sortable() // Enable sorting
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))
.Excel(excel => excel
.FileName("Excel.xlsx")
.Filterable(true)
.AllPages(true)
.ProxyURL(Url.Action("Excel_Export_Save", "CurrentController"))
)
.Events(events => events.Change("onGridChange"))
)
and the GetList action:
public ActionResult GetList([DataSourceRequest]DataSourceRequest request, string filtro_texto)
{
IQueryable<
Products
> products = _uow.GetProducts();
.............
DataSourceResult result = products_model.ToDataSourceResult(request);
return Json(result, JsonRequestBehavior.AllowGet);
}
I see that the GetList action is called two times, one with the request pageSize = 0, and other with the request pageSize = 10
Is there any problem in my code? Is it a nomal behaviour?
Best regards