The last column of my grid contains some custom buttons. The grid itself is built using a row template. When I export to PDF, I need to hide the last column. I followed the instruction on how to use the PdfExport event to hide the column and then re-display it on the promise.done, but couldn't get it to hide the column on the PDF. To see where I was going wrong, I added the code snippet below to the Basic usage example for the Grid and it worked as expected. However, when I modified the Row template example for the Grid, it didn't hide the column on the PDF.
toolbar: ["pdf"],
pdf: {
allPages: true,
avoidLinks: true,
paperSize: "A4",
margin: { top: "2cm", left: "1cm", right: "1cm", bottom: "1cm" },
landscape: true,
repeatHeaders: true,
scale: 0.8
},
pdfExport: function(e) {
var grid = $("#grid").data("kendoGrid");
grid.hideColumn(0);
e.promise.done(function() {
grid.showColumn(0);
});
},
I was wondering if this functionality (i.e. hide column on Pdf Export) is not supported with row templates, or if I'm just doing something stupid (more than likely the case)?
Thanks, Gregg