Export to Excel button

2 posts, 0 answers
  1. Julian
    Julian avatar
    5 posts
    Member since:
    Oct 2017

    Posted 07 Nov 2017 Link to this post

    Code -

     

    @Html.Kendo().Grid(ViewBag.FSTableData as System.Data.DataTable).Name("RevGrid").Pageable().Sortable().Filterable().ToolBar(tools => tools.Excel()).Excel(excel => excel.FileName(@ViewBag.TableNameCleanExcel).AllPages(true)).DataSource(dataSource => dataSource
    .Ajax()
    .ServerOperation(false)
    .PageSize(20)
    .ServerOperation(false)
    )

     

    Hi there ,

     

    I was woundering if it is possible to add an ID to the Export  To Excel button . What I need to do to if fire the button as soon as the pages loads . The grid we create are very dynamic and some user would just need the SpreadSheet downloaded .

     

    Julian

  2. Stefan
    Admin
    Stefan avatar
    2893 posts

    Posted 09 Nov 2017 Link to this post

    Hello, Julian,

    If the Grid has to be exported after the page loads, we can recommend calling the saveAsExcel method of the Grid. As the Grid already has an ID, calling the method for the corresponding Grid should be possible with no additional code:

    https://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-saveAsExcel

    Also, the button can be located with the Grid ID and the "k-grid-excel" class.

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top