Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Customize Print Settings When Printing GridControl

This example shows how to set the paper orientation to Landscape when printing Grid Control data. To customize print settings, the BaseView.PrintInitialize event is handled. The Landscape option is accessed via the PrintingSystem.PageSettings property.

using DevExpress.XtraPrinting;

private void gridView1_PrintInitialize(object sender, DevExpress.XtraGrid.Views.Base.PrintInitializeEventArgs e) {
    PrintingSystemBase pb = e.PrintingSystem as PrintingSystemBase;
    pb.PageSettings.Landscape = true;
}

//Show a print preview to test the Landscape paper orientation
gridView1.ShowPrintPreview();