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
665
Using UltraGridExcelExporter with UltraControlContainerEditor columns
posted

Hello,

I'm using WinForms, Infragistics 10.3 in Visual Studio 2010 targeting the .NET 4.0 Framework.

I have a UltraGrid which uses UltraControlContainerEditor for several columns.

When I export the grid using UltraGridExcelExporter the columns which use the UltraControlContainerEditor do not get exported correctly.

Instead of the numbers being placed in the cells picture box are placed over the cell with a picture of the number in. This causes me a problem as part of the reason the data needs exporting is that my users what to create custom formulas in their spreadsheet software.

Any help greatly appreciated.

  • 469350
    Offline posted

    Hi,

    The UltraGridExcelExporter doesn't have any good way of dealing with a ControlContainerEditor. It knows how to deal with the built-in editors, but since your container control could be anything, it doesn't really know what to do with it.

    So what is does is it creates an image of the RendingControl of the editor and exports the image to Excel.

    If that's not what you want, then it's pretty easy to stop it from doing this. All you have to do is remove the editor from the export layout. 


            private void ultraGridExcelExporter1_ExportStarted(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.ExportStartedEventArgs e)
            {
                // Use one or the other of these, depending on this one you are setting.
                
                e.Layout.Bands[0].Columns["my Column"].EditorComponent = null;
                //e.Layout.Bands[0].Columns["my Column"].Editor = null;
            }