Hi,
I'm using the UltraGridPrintDocument to print my grid.
How do I:
1. Center the content in the page?
2. Remove the filter sign and the row selectors?
Thanks
Hello Amiram,
As a possible approach you could hook onto the 'InitializePrintPreview' of the grid.
Please review the following code sample:
private void ultraGrid1_InitializePrintPreview(object sender, Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs e) { e.PrintLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False; e.PrintLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False; e.PrintDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(300, 300, 300, 300); }
private void ultraGrid1_InitializePrintPreview(object sender, Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs e)
{
e.PrintLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False;
e.PrintLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
e.PrintDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(300, 300, 300, 300);
}
The tricky part here is that you would have to calculate the margins depending on the grid content.
Please feel free to let me know if I misunderstood you or if you have any other questions.