New to Telerik UI for ASP.NET Core? Download free 30-day trial

Exporting Multiple Grids to Excel


Product Version 2022.2.621
Product Grid for ASP.NET Core


How can I export multiple Grids to the same Excel file?


The example below relies on the following key steps:

  1. Create an external button to export the data when it is clicked.
  2. Use the client-side saveAsExcel method to trigger the data export of each Grid.
  3. Handle the ExcelExport event of the two Grids and prevent their default action.
  4. Create a new Workbook by using the sheets of the Grids Workbooks and save it through the kendo.saveAs() method.
    //Export to Excel Button
        .Content("Export to Excel")
        .Events(ev => ev.Click("exportDataClick"))

    //First Grid
        .Columns(columns =>
            columns.Bound(p => p.ProductName);
            columns.Bound(p => p.UnitPrice);
            columns.Bound(p => p.UnitsOnOrder);
            columns.Bound(p => p.UnitsInStock);
        .Events(e => e.ExcelExport("products_excelExport"))
        .DataSource(dataSource => dataSource
            .Read(read => read.Action("Excel_Export_Read", "Grid"))
    //Second Grid
        .Columns(columns => {
            columns.Bound(p => p.OrderID).Filterable(false).Width(100);
            columns.Bound(p => p.Freight).Width(100);
            columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}").Width(140);
            columns.Bound(p => p.ShipName);
            columns.Bound(p => p.ShipCity).Width(150);
        .Events(e => e.ExcelExport("orders_excelExport"))
        .DataSource(dataSource => dataSource
            .Read(read => read.Action("Orders_Read", "Grid"))
    <script src=""></script>
        // Use Promises to sync the exports.
        var promises = [

        function exportDataClick(e) { //"Export to Excel" button "click" event handler.
            // Trigger export of the "products" Grid.
            // Trigger export of the "orders" Grid.
            // Wait for both exports to finish.
            $.when.apply(null, promises)
            .then(function (productsWorkbook, ordersWorkbook) {
                // Create a new workbook using the sheets of the "products" and "orders" workbooks.
                var sheets = [
                sheets[0].title = "Products";
                sheets[1].title = "Orders";
                var workbook = new kendo.ooxml.Workbook({
                    sheets: sheets
                // Save the new workbook.
                    dataURI: workbook.toDataURL(),
                    fileName: "ProductsAndOrders.xlsx"
        function products_excelExport(e) { //"ExcelExport" event handler of "products" Grid.
        function orders_excelExport(e) { //"ExcelExport" event handler of "orders" Grid.

For a runnable example based on the code above, refer to the REPL project on exporting multiple Grids to Excel.

More ASP.NET Core Grid Resources

See Also

In this article