Home Forums WinForms controls Xceed Grid for WinForms PrintPreview in landscape

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #13931 |

    Following the examples included in the documentation, I can print my grid.
    I can instantiate a GridPrintDocument and use a PageSetupDialog to allow the user to specify printing in landscape orientation. Or, I can use the grid’s PrintPreview method to preview the grid before it’s printed, but only in Portrait mode.

    Is there any way to preview the grid the way it is going to be printed? And isn’t that the definition of the word “preview”? I want the user to be able to select landscape or portrait mode and then see a preview of the print job as it will actually appear before sending the job to the printer.

    Is this possible?

    Jon Z

    Imported from legacy forums. Posted by AlphaGuys (had 2600 views)

    User (Old forums)
    Member
    Post count: 23064

    Here’s how you could do it (code has not been tested):<code>using(PrintPreviewDialog dlg = new PrintPreviewDialog()) {
    dlg.Document = doc; // doc = your GridPrintDocument
    dlg.ShowDialog(form); // form = your main Form (or null)
    }</code>

    Imported from legacy forums. Posted by Tommy (had 301 views)

    User (Old forums)
    Member
    Post count: 23064

    Excellent suggestion, it works when I test it. Thanks!

    Imported from legacy forums. Posted by AlphaGuys (had 3487 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.