Hi Thomas,
Thanks for using Syncfusion Products.
We are glad to let you know that your requirement
can be achieved by using clientside event “OnToolbarClickEvent”. In that event handler
we can be bind values to ExcelToExport action. Please refer the following code
snippets.
Code Snippet:
[CONTROLLER]
public ActionResult GridFeatures()
{
…
ClientSideEvents = new ClientSideEvents() { OnToolbarClickEvent = "ToolbarClick" },
…
}
public ActionResult ExportToExcel(string CustomerID)
{
var data = new GridSample1.Models.StudentDataContext().Student.Take(100).ToList();
return data.GridExportToExcel<Student>("GridExcel.xlsx", ExcelVersion.Excel2007);
}
[JAVASCRIPT]
function
ToolbarClick(sender, args) {
$('#GenericListGrid_exportExcel').append($('#CustomerID'));
}
For your convenience we have created a sample and
the same can be downloaded from below link.
Sample:
http://www.syncfusion.com/downloads/support/directtrac/121679/GridSample1-1459410709.zip
Please let us know if you have any queries.
Regards,
Alan Sangeeth S