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
195
UltraWinGrid Excel Export w/BindingSource
posted

I've got an interesting issue with the UltraWinGrid when exporting to Excel.

My data is an Invoice object from NHibernate with a HasMany collection of Detail records.  

IF I bind my UltraWinGrid to a BindingSource and set the datasource of the BindingSource to a List<Invoice> and export the grid, I do NOT get any of the detail records, although I DO get an expansion indicator.

IF I bind my UltraWinGrid directly to the List<Invoice> and export the grid, I DO get the detail records exported.

This can be seen in the attached spreadsheets

If I handle the RowExporting event, I find the row that does NOT export the data has no columns in the detail band, while the one that does export properly has all the columns.  Again, the only thing changing is the grid is bound to a binding source vs. binding directly to the data.

ultraGridJobs_BindingSource.zip
Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    So... are you saying that the child records are showing up in the on-screen grid with the columns but that they simply do not export?

    I don't see how that could be the case, unless something in your code is modifying the layout for exporting. The grid clones the layout for exporting, so if there are column on the screen, those same columns should be in the export layout.

    I'm not familiar with NHibernate, so I suppose it's possible that something about it is causing the cloning of the grid layout to fail, but without a sample project demonstrating this behavior, I can only speculate.

Children