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
615
Printing directly from an Ultragrid using the .Print() command hangs.
posted
When I call this.ultraGrid1.Print(), the call waits forever to return. There are rows in the grid and there are 3 columns. I have even added an eventhandler for the InitializePrint event which looks like this: void ultraGrid1_InitializePrint(object sender, Infragistics.Win.UltraWinGrid.CancelablePrintEventArgs e){e.PrintLayout.BorderStyle = Infragistics.Win.UIElementBorderStyle.None;e.DefaultLogicalPageLayoutInfo.PageHeaderBorderStyle = Infragistics.Win.UIElementBorderStyle.None;e.DefaultLogicalPageLayoutInfo.PageFooterBorderStyle = Infragistics.Win.UIElementBorderStyle.None;e.DefaultLogicalPageLayoutInfo.PageHeader = "Print pagina <#>";e.DefaultLogicalPageLayoutInfo.PageFooter = "Offerte";e.DefaultLogicalPageLayoutInfo.PageHeaderHeight = 20;e.DefaultLogicalPageLayoutInfo.PageFooterHeight = 40;e.PrintDocument.DocumentName = "Print klant";e.PrintDocument.DefaultPageSettings.Margins.Left = 50;e.PrintDocument.DefaultPageSettings.Margins.Right = 50;e.PrintDocument.DefaultPageSettings.Margins.Bottom = 50;e.PrintDocument.DefaultPageSettings.Margins.Top = 50;e.PrintDocument.DefaultPageSettings.Landscape = true;} And a button which calls this.ultraGrid1.Print() when clicked.

Is this a known problem or am I missing something?

Parents
No Data
Reply
  • 37774
    posted

    Are you passing in a PrintDocument to the method?  Are you sure that the printer that you have the grid set to print to is actually available and responds in other applications?  All of the code that you posted is basically appearance-related, so I'm not really sure how that would cause the appliation to hang.  It seems like it's waiting on a response from the printer and/or driver.

    -Matt

Children