We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

ExportExcelAction GridPropertiesModel Equivalent

Thread ID:





116062 Mar 25,2014 04:50 PM Mar 27,2014 02:23 AM ASP.NET MVC (Classic) 1
Tags: Grid
Thomas Kiehl
Asked On March 25, 2014 04:50 PM

I need to know how to accomplish the mapping of additional parameters to the expel export in the GridProperties model.

This is what works in the GridBuilder
.Mappers(map =>
                map.ExportExcelAction("ExportOrderDetails", new { account = Model.Order.CustomerNumber, orderNumber = Model.Order.OrderNumber });

            .ToolBar(tools =>

What is the equivalent of the above using the gridpropertiesmodel?

ToolbarSettings toolbar = new ToolbarSettings();
            toolbar.Enable = true;
            toolbar.Items.Add(new ToolbarOptions() { ItemType = GridToolBarItems.ExcelExport, Caption = "ExportOrderDetails", Mapper =  ?????});
            gridModel.ToolBar = toolbar;

Alan Sangeeth S [Syncfusion]
Replied On March 27, 2014 02:23 AM

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:


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);


function ToolbarClick(sender, args) {



For your convenience we have created a sample and the same can be downloaded from below link.



Please let us know if you have any queries.

Alan Sangeeth S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.