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
1834
How do I maximize UltraGrid print preview dialog by default?
posted

I couldn't find an answer to this, when I do the print preview, I want it to open maximized.

I am calling grid.PrintPreview(UltraGridLayout layout, PrintDocument printDocument, RowPropertyCategories retainRowPropertyCategories) from a button click event, then setting layout data in grid_InitializePrintPreview.  In this latter function, I see how to change the dialog height and such in e.PrintPreviewSettings, but not its window state.  Is that possible?

Thanks,

J

  • 469350
    Offline posted

    Hi J,

    Actually, there is a way to do this using the UltraPrintPreviewDialog instead of the built-in print preview in the grid. You need an UltraGridPrintDocument, too.


                this.ultraGridPrintDocument1.Grid = this.ultraGrid1;
                this.ultraPrintPreviewDialog1.Document = this.ultraGridPrintDocument1;           
                this.ultraPrintPreviewDialog1.Show(this);
                this.OwnedForms[0].WindowState = FormWindowState.Maximized;

  • 69832
    Offline posted

    No, there does not appear to be a way to get at the PrintPreviewDialog. It might be possible to cancel the InitializePrintPreview event, and then show the dialog yourself therein, in which case you would be able to set any of the properties of the PrintPreviewDialog. Note that I haven't tried this and I don't know if sufficient information is provided in the event arguments to be able to do the same thing we do internally.

    You might want to submit a feature request for the addition of a property to the PrintPreviewSettings class that returns a reference to the dialog itself.