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
185
AfterColPosChanged
posted

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

 

 

 

 

 

 

 

 

Me.SaveFileDialog.DefaultExt =

".pdf"

 

 

 

Me

.SaveFileDialog.ShowDialog()

 

 

 

If SaveFileDialog.FileName <> ""

Then

 

 

 

Me.UltraGridDocumentExporter1.Export(Me.ugForms, Me.SaveFileDialog.FileName, Infragistics.Win.UltraWinGrid.DocumentExport.GridExportFileFormat

.PDF)

 

 

 

End

If

 

 

 

End Sub

This problem does not occur using the Excel exporter or PrintDocument.  Those behave as expected.

 

Parents
  • 469350
    Offline posted

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

Reply Children