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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid MultipleExporting to Excel Waiting popup

Thread ID:





130890 Jun 8,2017 03:34 PM UTC Jun 14,2017 06:50 AM UTC ASP.NET MVC 1
Tags: Grid
Asked On June 8, 2017 03:34 PM UTC


I have four grid in my view page and I want to export in one excel file.
I used this sample http://mvc.syncfusion.com/demos/web/grid/multipleexporting and works fine.

Now i want to add a waiting popup, i tried to use this sample

but in model passed to controller by ajax call 


          type: "POST", 
          url: url, 
          data: { GridModel: JSON.stringify(model) }

public ActionResult MultipleExportTo(string[] GridModel, string typeExport)
            //typeExport -> "xlsx" or "pdf"
            for (int i = 0; i < GridModel.Count(); i++) 

i find only the first grid.

GridModel.Count()=1 !! 

How to pass all the grids ? 


Venkatesh Ayothi Raman [Syncfusion]
Replied On June 14, 2017 06:50 AM UTC

Hi Nicola, 

Thanks for contacting Syncfusion support. 

In this “https://www.syncfusion.com/forums/126072/ejgrid-export-to-excel-waiting-popup  forum we have send the GridModel to server side for a single Grid. But your scenario you are using multiple Grid then we suggest you to send the all Grid models in AJAX post. 

For demonstration purpose, we have passed the two Grid model’s to server side like as follows, 
Code example
First Grid 
                 .ToolbarSettings(toolBar => toolBar.ShowToolbar().ToolbarItems(items => 
                                                                                 .ClientSideEvents(eve => 
                      .Columns(col => 
            . . . 
Second Grid 
<div class="label1"> 
    Orders Grid 
        .Columns(col => 
            . . . 
function toolbarClick(args) { 
            var url = null; 
            if (args.itemName == "Excel Export") { 
                args.cancel = true; 
                url = "/Grid/MultipleExportToExcel"; 
            if (args.itemName.indexOf("Export") != -1) { 
                $(".e-grid").ejWaitingPopup("show"); //show the waiting popup for all Grid 
                var firstGridModel = this.model, secondGridObject = $("#DetailGrid").data("ejGrid"), secondGridModel = secondGridObject.model, allModel = [JSON.stringify(firstGridModel), JSON.stringify(secondGridModel)]; 
                var model = $.extend(true, [], allModel); 
                . . . 
                type: "POST", 
                url: url, 
                data: { GridModel: model },//pass the grid model 
                dataType: "json", 
                success: function (response) { 
                    $(".e-grid").ejWaitingPopup("hide");//hide the waiting popup for all Grid 
                    alert("Grid Exported"); 
                error: function (Result) { 
                    $(".e-grid").ejWaitingPopup("hide"); //hide the waiting popup for all Grid 
                    alert("Grid Exported"); 
            });            } 
@Control side 
  public object MultipleExportToExcel(string[] GridModel) 
            ExcelExport exp = new ExcelExport(); 
            var EmployeeData = new NorthwindDataContext().EmployeeViews.Take(5).ToList(); 
            var OrderData = new NorthwindDataContext().OrdersViews.Take(5).ToList(); 
            bool initial = true; 
            IWorkbook book = null; 
            foreach (string gridProperty in GridModel) 
                GridProperties gridProp = ConvertObject(gridProperty); 
                if (initial) 
                    gridProp.Locale = ""; 
                    book = exp.Export(gridProp, EmployeeData, "Export.xlsx", ExcelVersion.Excel2010, true, true, "flat-saffron", true); 
                    initial = false; 
                   exp.Export(gridProp, OrderData, "Export.xlsx", ExcelVersion.Excel2010, true, true, "flat-saffron", false, book, MultipleExportType.AppendToSheet, "Second Grid"); 
                    book.SaveAs(@"C:\Uploadfiles\Export.xlsx");   //save the file in local. Here you can specify the your own path                
            return Json(EmployeeData,JsonRequestBehavior.AllowGet); 

Refer to the following Help documentation for saving the work book as local save, 
We have also prepared a sample for your convenience which can be download from following link, 

Venkatesh Ayothiraman. 


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon