This is a migrated thread and some comments may be shown as answers.

Export to Excel button

1 Answer 173 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 07 Nov 2017, 04:05 PM

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

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 09 Nov 2017, 08:05 AM
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.
Tags
Grid
Asked by
Julian
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or