Hi,
I was trying to use the UltraPrintPreview control to print the grid. On my main form, I have a UltraGrid and a button that will trigger the function to print the grid with a UltraPrintPreview control:
--------------code start-----------------------UltraGridPrintDocument^ doc = gcnew UltraGridPrintDocument(); doc->FitWidthToPages = 1; doc->Page->Margins->Top = 0.5; doc->Page->Margins->Bottom = 0.5; doc->Page->Margins->Left = 0.5; doc->Page->Margins->Right = 0.5; doc->Grid = this->ultraGrid1; doc->Header->TextCenter = "Title"; doc->Header->TextRight = "Name"; doc->Header->Height = -1; doc->PageBody->Margins->Top = 15; Infragistics::Win::Printing::UltraPrintPreviewDialog^ dialog = gcnew Infragistics::Win::Printing::UltraPrintPreviewDialog(); dialog->Document = doc; dialog->ShowDialog(this); dialog->Document = nullptr; delete doc; delete dialog; doc = nullptr; dialog = nullptr;--------------end of code---------------------------------
Everything works as expected if I maximized the main form (parent window) when clicking the print button. But if the main form was not maximized when the print button was click, the grid will not auto resize according to the paper - it seems that it will just resize according to the PrintPreviewDialog's size: I've also tried setting the UltraPrintPreviewDialog's window state to Maximized before calling ShowDialog(), but it doesn't have any effects on the grid resizing. It seems like as long as the parent window is not maximized when the UltraPrintPreviewDialog was created, the grid will not resize correctly no matter what. Is this a bug or am I missing something? Thanks!
Do you have the latest Hot Fix? I think this might be a bug that was fixed a while ago.
If the latest Hot Fix does not help, you should Submit an incident to Infragistics Developer Support.
Mike,
I've managed to installed the latest 8.1.20081.2123 hot fix, but it still has the same print sizing problem. Any ideas?
In that case, I recommend that you create a small sample project which demonstrates the issue and Submit an incident to Infragistics Developer Support so they can check it out.