I'm getting the following error when trying to call the method .saveAsExcel(): "Unable to get property 'length' of undefined or null reference"
Here is code:
$(".download-excel").on("click",
function() {
try {
var grid = $("#DataGrid").data("kendoGrid");
grid.saveAsExcel();
} catch (e) {
fnDialog('Error Exporting Excel',
'There was an error exporting the excel document. Please contact customer service.',
null,
null);
}
});
If I set a watch on the grid object, I can see the data. For some reason it fails at the grid.saveAsExcel();