Thank you for providing those additional details along with a screenshot.
Here is one example you can make the grid fit the whole PDF page. In the PreRender event, when exporting apply 100% width for the grid.
sender, EventArgs e)
RadGrid1.Width = Unit.Percentage(100);
You will also need to eliminate the additional space consumed by the page margins. To do that, you can set the PDF page margins accordingly.
- code behind
sender, GridCommandEventArgs e)
RadGrid1.ExportSettings.Pdf.PageLeftMargin = Unit.Point(-1);
RadGrid1.ExportSettings.Pdf.PageRightMargin = Unit.Point(-1);
RadGrid1.ExportSettings.Pdf.PageTopMargin = Unit.Point(-2);
RadGrid1.ExportSettings.Pdf.PageBottomMargin = Unit.Point(-2);
It can be set in the markup
as well, but I believe that you would like to keep the whole export configuration in the code behind. Nevertheless, the ExportSettings tag should be as follows:
Attached, you can find out how the exported file looks like. It is up to your needs how you would configure the margins.
Let me know if this is not the exact scenario you are willing to achieve. I would be happy to dig deeper and provide a clear-cut answer based on any additional information you provide me with.
Get quickly onboarded and successful
with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.