im using printpreviewdialog to show grid data.i have multi level grid which expanded is 2 pages wide (when viewed in portrait). The problem is that when i dont expand the grid it should fit in one page but the print preview still puts it in 2 pages thus every sencond page is empty. I figure it happens because the grid width that is passed to dialog is the width of grid when everything is expanded. Could someone knows how could i resolve this?
From my conversation with Infragistics Support
==================
Support:
Hello Andrej,Our developers have completed their review of development incidentBR26149. They have determined that this is "Not a Bug" issue for thefollowing reasons: "There is actually only a single logical page generated in this case,though it results in two physical pages for this. The reason is thatthe page sizes are calculated based on the extent of the bands(including the child band); this is because we do not loop through eachrow when determining the page sizes for efficiency reasons and havingonly a single expanded row would cause the page to extend beyond thewidth of the first physical page. Moreover, there could be a secondlogical page generated further down the process that *does* have somechild rows expanded that would extend onto the 2nd physical page, sohaving a blank page as part of the first logical page would make sensefor someone collating the copies.Please refer the structure:[LogicalPage #1]Page 1 Page 2[LogicalPage #2]Page 3 Page 4There are a couple workarounds for this issue. The first would be tohide the child band when printing, such as:private void ultraGrid1_InitializePrintPreview(object sender,Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs e){ e.PrintLayout.Bands[1].Hidden = true;}This might not be a viable solution so an alternative would be to forceeach logical page to only have 1 physical page, such as:private void ultraGrid1_InitializePrintPreview(object sender,Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs e){ e.DefaultLogicalPageLayoutInfo.FitWidthToPages = 1; } "
===========================
Yours truly
I agree with the argumentation of your developers. Could you please make a feature request on my behalf to make the parameter UltraGridPrintDocument .FitWidthToPages configurable from UltraPrintPreviewDialog (either as a textbox or as a checkbox)? It would be probably necessary to move this property up to Infragistics.Win.Printing.UltraPrintDocument. ===========================
Hello Andrej,As per your suggestion, I have logged a feature request on your behalf with the following description so that this functionality may be added to a future release. Your reference number for this feature request is FR08062. Description: "Customer requires the ability to configure the FitToWidth property of UltraGridPrintDocument control by UltraPrintPreviewDialog as a TextBox or as a CheckBox."
Concerning feature request: I've never seen (in last 3 years that Infragistics implemented any of our feature requests)... Hm. Wrong. They did publish .pdb files
thanks