Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3550
Print landscape
posted

I want to print landscape

I use the ultraGridPrintDocument.

The following code still doesnt print landscape.

ultraGridPrintDocument1.DefaultPageSettings.Landscape;

PrintGrid.Print();

  • 469350
    Offline posted

    Hi,

    What is "PrintGrid" in this sample code? Is that the grid? If so, then calling the Print method of the grid will print the grid directly to the printer so you will be bypassing your UltraGridPrintDocument entirely. Which would explain why this does not work.

    So the question then becomes, why are you using UltraGridPrintDocument? You don't need an UltraGridPrintDocument just to print the grid in Landscape mode. You can just do this:


            private void ultraGrid1_InitializePrint(object sender, CancelablePrintEventArgs e)
            {
                e.PrintDocument.DefaultPageSettings.Landscape = true;
            }