Hi,
I discovered an export to Excel is failing in a specific case when using a multiband grid. It's too specific to explain, but my attached sample project demonstrates the problem.
If you run my program and export the grid data to Excel, the rows containing 'Item 1.1.2' and below are placed two cells too far to the right (they should start in column A).
I know the layout is doing unusual things like adding dummy columns in the first band and hiding the column headers of the other bands, but this creates the visual result the product owner requires.
I ran your sample and I see what you are describing. But the behavior you seem to expect is not correct.
The child rows are supposed to be intended.
There appears to be a bug here, but the bug is that the "Category 1.1" and "Item 1.1.1" are NOT being indented properly. This seems to be caused by the hiding of the column headers for those bands.
Now for the good news. This bug was fixed a long time ago. I tested your sample with v11.2 and it works fine.
But, that's probably small consolation, since the intended behavior is apparently not what you want, anyway. So, if you want to flatten the list so every row exports to the "A" column in Excel, you could achieve that in a couple of ways. Here's the workaround I'd use:
void ultraGridExcelExporter1_BeginExport(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.BeginExportEventArgs e) { foreach (UltraGridBand band in e.Layout.Bands) { band.Indentation = 0; } }
Thanks for the workaround!The product owner told me that indentation of the child bands would in fact be a better solution, but I don't see how the column headers match up with the data of those child bands in that case (we would need to upgrade to v11.2 first of course).