I took help from the sample given on this URL:
https://www.telerik.com/kendo-angular-ui/components/grid/api/ToolbarTemplateDirective/
To update about my progress on the issue, I edited my code to add a button and write the below code on its 'onclick' event:
<button id=
'exportEx'
onclick=
'$("#myGrid").data("kendo-grid").saveAsExcel();'
>Export to Excel</button>
but this code is exporting only the rows on the 1st page and not from all pages. I want all data exported at once. The entire data is being bound with the grid in one Ajax call and not in chunks, like this:
jQuery(
"#myGrid"
).data(
"kendoGrid"
).dataSource.data(ajaxResponse);