Export data from Kendo-UI grid


User 1451111

The KendoUI grid code in my app is declarative like this:

<kendo-grid id="myGrid" options="mainGridOptions">
    <kendoGridToolbarTemplate>
            <button kendoGridExcelCommand>Export to Excel</button>
         <kendo-grid-excel fileName="GridData.xlsx">
           </kendo-grid-excel>
    </kendoGridToolbarTemplate>
    <div k-detail-template>
        <kendo-tabstrip> Some DIVs and fields here </kendo-tabstrip>
    </div>
   <kendo-grid-excel fileName="Products.xlsx"></kendo-grid-excel>
</kendo-grid>

The data source for this grid is attached at runtime. I'm trying to make the " Export to Excel" button available, but it doesn't work. What am I doing wrong?

User 1451111

For anyone who stumbles upon this problem in the future, here is the solution. If a template is used, the button to export the grid to Excel must programmatically call the saveAsExcel method. Since I'm using a template, I add a button and write its onclick event like this:

<button id='exportEx' onclick='$("#myGrid").data("kendo-grid").saveAsExcel();'>Export to Excel</button>

Related


kendo ui grid data not showing from php

username I want to display data into my kendo grid. I am using basic php mysql to return results from database. Here is my kendo javascript code. <script> $(document).ready(function () { $("#grid").kendoGrid({ dataSource: {

kendo ui grid data not showing from php

username I want to display data into my kendo grid. I am using basic php mysql to return results from database. Here is my kendo javascript code. <script> $(document).ready(function () { $("#grid").kendoGrid({ dataSource: {

Kendo UI Grid removes outline of HTML elements from PDF export

Dutch laboratory I have a Kendo UI Grid which has a dropdown element on a form. When I export to PDF, the selected value appears on the PDF, but there is an outline of the selected element around it. How to remove outlines of elements when exporting to pdf? Ca

Kendo UI Grid removes outline of HTML elements from PDF export

Dutch laboratory I have a Kendo UI Grid which has a dropdown element on a form. When I export to PDF, the selected value appears on the PDF, but there is an outline of the selected element around it. How to remove outlines of elements when exporting to pdf? Ca

Export all data from Kendo Grid data source

Paul I followed a tutorial on exporting Kendo grid data : http://www.kendoui.com/blogs/teamblog/posts/13-03-12/exporting_the_kendo_ui_grid_data_to_excel.aspx Now, I'm trying to export all the data (not just the displayed page)... how can I do this? I try to ch

Kendo UI Multi-Grid Excel Export

Vincent Here is the code I use to export Kendo multiple grids to Excel, how do I export all pages Example - Multi-Grid Excel Export Jayesh Goyani Please try the following code snippet. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Kendo U

Export CSV - Kendo UI Grid with Filters

Chris There is out-of-the-box support for exporting Kendo Grid data in Xlsx and Pdf formats, I'm looking for something similar to export in Csv format. I've tried the server export described here: https://demos.telerik.com/aspnet-mvc/grid/server-export and it

Kendo UI Grid export to Excel not working

Nick Soder I have a similar question, why is my excelexport button not working? What's wrong Thanks for help. $("#grid").kendoGrid({ toolbar: ["create", "excel", "pdf"], excel: { fileName: "Test.xlsx", allPages: true }, columns: [ {

Kendo UI Multi-Grid Excel Export

Vincent Here is the code I use to export Kendo multiple grids to Excel, how do I export all pages Example - Multi-Grid Excel Export Jayesh Goyani Please try the following code snippet. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Kendo U

Kendo UI Multi-Grid Excel Export

Vincent Here is the code I use to export Kendo multiple grids to Excel, how do I export all pages Example - Multi-Grid Excel Export Jayesh Goyani Please try the following code snippet. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Kendo U

Kendo UI Grid export to Excel not working

Nick Soder I have a similar question, why is my excelexport button not working? What's wrong Thanks for help. $("#grid").kendoGrid({ toolbar: ["create", "excel", "pdf"], excel: { fileName: "Test.xlsx", allPages: true }, columns: [ {

Kendo UI Grid export to Excel not working

Nick Soder I have a similar question, why is my excelexport button not working? What's wrong Thanks for help. $("#grid").kendoGrid({ toolbar: ["create", "excel", "pdf"], excel: { fileName: "Test.xlsx", allPages: true }, columns: [ {

Kendo UI Multi-Grid Excel Export

Vincent Here is the code I use to export Kendo multiple grids to Excel, how do I export all pages Example - Multi-Grid Excel Export Jayesh Goyani Please try the following code snippet. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Kendo U

How to render Kendo UI grid from AJAX response data?

XIMRX I have this code to get json object from static url and then render grid. But I want to use the json data retrieved as an AJAX response and then render the grid with this response text. Because for actual deployment I can't use static URL. $("#grid")

How to render Kendo UI grid from AJAX response data?

XIMRX I have this code to get json object from static url and then render grid. But I want to use the json data retrieved as an AJAX response and then render the grid with this response text. Because for actual deployment I can't use static URL. $("#grid")

Sort Grid data in Kendo UI Grid

Masood I want to sort the retrieved data to the description field, but I can't sort it. UI code: Display data correctly var gridDataSource = new kendo.data.DataSource({ autoSync: true, data: transformation.Activities, schema: { model: {

Unable to bind data using Kendo ui grid

Natalaran Nagarazugari This is my action method public ActionResult Kendo([DataSourceRequest]DataSourceRequest request ) { var emp = EmployeeManager.GetAllEmployees(); DataSourceResult result = emp.ToDataSourceResult(request); ret

Kendo UI Grid, sorting data source groups

Ben Cameron I have a page with a kendo grid on it. It is calling ajaz web request to get its data. After the data is returned, it will be grouped on the front end. The problem I'm having is sorting the groups. What's the best way to do this? My MVC view code l

Unable to bind data using Kendo ui grid

Natalaran Nagarazugari This is my action method public ActionResult Kendo([DataSourceRequest]DataSourceRequest request ) { var emp = EmployeeManager.GetAllEmployees(); DataSourceResult result = emp.ToDataSourceResult(request); ret

Kendo UI Grid pass data to another form

Nixon I have this demo related to my situation , how to bind additional data dataSourceinto my popup form. If, a popup form will appear outletType = rest. thanks for your help. Dojo Demo don't vote for me You don't need to set extra data , data from all data s

How to manually load data in Kendo UI grid

Taversi I have a kendo ui grid. I want to load the grid manually. For example, when my page loads, the grid doesn't load, but when I click the button, the data loads into the grid. what should I do? thanks. Johnny Hong Kong Automatic loading from the grid's da

Kendo UI, grid, modify data before sending

Internet duvet Is it possible to access and modify data in the Kendo UI grid before updating? Below is an example to illustrate what I need. There is no real convenient form in options.datacontaining the sent data, but it has been formatted as a string ."model

Kendo UI Grid select by data item

ablago I have a Kendo UI grid with a large data source and paging. I have an event that fires where I know the underlying data item to be selected, but not sure how to paginate/select the item in the grid programmatically. If the item is not on the current gri

Create a basic data grid with Kendo UI and AngularJS

Node newbie I am trying out AngularJS. I want to show a basic kendo grid. I am trying to do this using pure directives. With that in mind, I looked into the Kendo UI/Angular JS project ( https://github.com/kendo-labs/angular-kendo ). Unfortunately, my index.ht

Kendo ui grid dropdown editor not loading data

Leonid Radkevich Unable to load data to Kendo dropdown. It fetches data from backend but the list is empty. The backend looks like: [HttpPost] public ActionResult GetCities(DataSourceRequest command) { var cityModel = _uow.Cities.GetAll().T

Unable to bind data using Kendo ui grid

Natalaran Nagarazugari This is my action method public ActionResult Kendo([DataSourceRequest]DataSourceRequest request ) { var emp = EmployeeManager.GetAllEmployees(); DataSourceResult result = emp.ToDataSourceResult(request); ret