I have an MVC4 page with the Syncfusion Grid and some filters around the grid (ListBox). These filters work perfect when using a pager (I declared an OnBeginAction where I store all current filter values in args.data).
But the default Export to Excel button is not able to do this. It can respond to a OnToolbarClickEvent. But this doesn't give me access to args.data.
SKSarath Kumar P Syncfusion Team November 21, 2013 12:35 PM UTC
Thanks for using Syncfusion products.
like to let you know that in toolbar click event for excel check the condition if (args._currentItemIndex ==
0) then save the value in a variable and append the variable to the Excel form.
In ExportToExcel action find the appended value in FormCollection fc variable.
Please refer the below code snippets for your reference.
public ActionResult ExportToExcel(PagingParams args, FormCollection
fc) //find the value in fc->base->All Keys.
var data = OrderRepository.GetAllRecords().Take(200).ToList();