How to set up kendo Grid with MVC extensions not do additional request when export to excel?
Here is grid definition. The problem is when export to excel button is clicked grid make additional request to server, it is needed to export displayed data without request.
@(Html.Kendo()
.Grid<VmTaskItem>()
.Name("kTasks")
.Columns(c => {
c.Bound(m => m.TaskType).Title().Width(150);
})
.ToolBar(tb => tb.Excel())
.Excel(e => e
.AllPages(false) // must disable request when export
)
.DataSource(ds => ds
.Ajax()
.PageSize(30)
.Read(r => r.Action("GetTaskItems", "Home")
.Type(HttpVerbs.Get))
))
From documentation https://docs.telerik.com/aspnet-mvc/helpers/grid/excel-export
When the AllPages option is set to true the Grid makes a read request for all data.
Also, at demo page for MVC Grid make addition request when export to excel
http://demos.telerik.com/aspnet-mvc/grid/excel-export
at demo page for Grid without MVC did not
http://demos.telerik.com/kendo-ui/grid/excel-export