The AfterColPosChanged event fires for each record in a grid when using the Infragistics.Win.UltraWinGrid.DocumentExport to print a PDF of the records in the grid. So, when executing the following code, the AfterColPosChanged event fires for each record in the grid:
Private Sub cmdPDFForms_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdPDFForms.Click
Me.SaveFileDialog.AddExtension = True
".pdf"
.SaveFileDialog.ShowDialog()
Then
.PDF)
If
This problem does not occur using the Excel exporter or PrintDocument. Those behave as expected.
Thank you.
Hello,
Base on this discussion I have created a support ticket with ID: CAS-56146-X77CJ3. So I will update you as soon as I have information for you via the case.
Thank you for using Infragistics Components.
Hi,
jdipilato said:Is this a known bug with the exporter or the AfterColPosChanged?
I guess I must have been thinking of a different event. I tried this out in the latest version and I get the same results you describe. The event is firing because the UltraGridDocumentExporter is Auto-sizing each column.
I'm not entirely sure this is a bug. The column is actually being resized.But we typically don't fire events like this for the print or export layouts, so this is something we need to look into. I'm going to forward this thread over to Infragistics Developer Support so they can create a case for you and enter this as a bug for developer review.
jdipilato said:The reason I ask is that I'm also noticing that with exporting large PDF files, clicking anywere on the form causes a 'not responding' message in the application title until it finishes. Again, this does not seem to be a problem printing and/or sending to Excel.
I don't think this has anything to do with the event firing. Both the DocumentExporter and the ExcelExport are synchronous and will lock up the UI. I'm guessing that the DocumentExporter just takes longer, since PDF is more complex.
Thank you. I am using 2010.3, and noticed this behavior in the earlier version as well.
Is this a known bug with the exporter or the AfterColPosChanged? The reason I ask is that I'm also noticing that with exporting large PDF files, clicking anywere on the form causes a 'not responding' message in the application title until it finishes. Again, this does not seem to be a problem printing and/or sending to Excel.
What version of the controls are you using? I'm pretty sure this is a known bug which was is already fixed.
How to get the latest service release - Infragistics Community
If I am wrong, and it's not fixed, or if you just don't want to upgrade, then there are a couple of ways you could work around the issue.
You could use the EventManager to disable that particular grid event during the export.
You could unhook the event during the export.
Or you could simply bail out of the event whenever it fires for a column in the export layout:
private void ultraGrid1_AfterColPosChanged(object sender, AfterColPosChangedEventArgs e) { if (e.ColumnHeaders[0].Band.Layout.IsExportLayout) return; }