How to set the pirnitng orientation of the ultragridprintdocument
Also,i am new to infragistics.
I didnt understand if there are any samples, to the different controls.
I use the 2008 version
I'll give you the snippet of code from one of my client projects since it shows how to do some useful stuff when it comes to printing out wingrids. They do have some great samples, check out the download available, you should be able to find the samples installer. I also recommend downloading the offline documentation. They put a lot of great information inside it that nobody seems to read. Good luck!
private void btnPrint_Click(object sender, EventArgs e) { UltraPrintPreviewDialog ultraPrintPreviewDialog1 = new UltraPrintPreviewDialog(); UltraGridPrintDocument printDoc = new UltraGridPrintDocument(); ultraGridPatientInformation.Rows.ExpandAll(true); printDoc.Grid = this.ultraGridPatientInformation; // Horizontally fit everything in a single page if (chkFitToPage.Checked) printDoc.FitWidthToPages = 1; // Set the document to print in landscape printDoc.DefaultPageSettings.Landscape = true; // Set the document name through the PrintDocument which returns a PrintDocument object. printDoc.DocumentName = "Patient Information Grid View"; // Set up the header and the footer printDoc.Header.TextCenter = txtReportTitle.Text; printDoc.Header.Appearance.FontData.SizeInPoints = 14.0F; printDoc.Footer.TextCenter = "- Page <#> -" + Environment.NewLine + DateTime.Now.ToString(); // Set the print preview document and show the window ultraPrintPreviewDialog1.Document = printDoc; ultraPrintPreviewDialog1.FindForm().MdiParent = this.MdiParent; ultraPrintPreviewDialog1.Show(); ultraPrintPreviewDialog1.FindForm().WindowState = FormWindowState.Maximized; ultraPrintPreviewDialog1.FindForm().TopMost = true; }
Thanks for posting this code.
Maybe you also know how to change page orientation from code after print dialog is showed?
P.S. If i only change Landscape property the page stays the same