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
450
WinGrid Export to Excel Flat
posted

Hello,

How can I export grid data (which is in expand/collapse format) to Flat Row/Column without Expand/ collapse?

Thanks

Venkatesh

Parents
  • 21795
    Offline posted

    Hello Venkatesh,

    When the export of the grid starts the grid layout gets cloned. During the export this cloned version is used. What you can do, to have grid exported as flat one without groups, is to clear the SortedColumns collection of the cloned layout band. Nice place to do this is in ExportStarted event of UltraGridExcelExporter. You can use code like this:

    private void UltraGridExcelExporter1_ExportStarted(object sender, ExportStartedEventArgs e)
    {
        e.Layout.Bands[0].SortedColumns.Clear();
    }

    Please check the attached sample project showing this approach and let me know if this is what you are looking for or if I am missing something.

    UltraGridFlatExcelExport.zip
Reply Children