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.
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; }
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.