I want to print landscape
I use the ultraGridPrintDocument.
The following code still doesnt print landscape.
ultraGridPrintDocument1.DefaultPageSettings.Landscape;
PrintGrid.Print();
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; }