I have a kendo grid with a column that is not displayed in the grid, but is conditionally included when exporting to excel.
However, this column is positioned as the last column in the sheet, instead of being positioned as defined in the grid column definition.
I have no idea what the issue may be.
Any help will be greatly appreciated.
This is the method by which I am conditionally including the column in the excel export:
excelExport: (e: kendo.ui.GridExcelExportEvent) => {
if (columnShouldShow) {
e.sender.showColumn('MyColumn');
e.preventDefault();
columnShouldShow = false;
setTimeout(() => {
e.sender.saveAsExcel();
});
} else {
e.sender.hideColumn('MyColumn');
columnShouldShow = true;
}
}