New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Disable Scrolling/UseStaticHeaders on PDFExport
Environment
Product Version | 2019.3.1023 |
Product | RadGrid for ASP.NET AJAX |
Description
As noted in the PDF Export Q&A, when the PDF Export produces a blank page, this is because of the ClientSettings for Scrolling and UseStaticHeaders. These need to be disabled. See the below solution.
Solution
Use the ItemCommand Grid Event to temporarily disable these features. After the command executes the settings will revert back to those set on the grid.
C#
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.ExportToPdfCommandName)
{
RadGrid1.ClientSettings.Scrolling.AllowScroll = false;
RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = false;
RadGrid1.Rebind();
}
}