I'm not sure what you mean by exporting a band and sub-bands. It think this might just be a problem of terminology.
There's no way to export a child row without it's parent row. Or at least, no easy way without writing a lot of code to modify the export using the events of the UltraGridExporter.
If you want to export a single row and all it's children, and the row in question is a root-level row, then this would be fairly easy. You just have to keep track of the row and then use the InitializeLayout event on the UltraGridExcelExporter to hide every parent row that is not the one you want.
Hi Mike,
How do I export just the parent row and not the child rows? I just want to export the Band 0.
Could you please help me on this.
Thanks & Regards,
Bhagyashree
Thanks Mike, I just did below and it worked fine
we just need to do below:
void ugExcelExporter_BeginExport(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.BeginExportEventArgs e)
{
// Do below if user setting ShowOnlyParentBand is set to true.
foreach (var band in e.Layout.Bands)
if (band.ParentBand != null)
band.Hidden = true;
}
Hi,
The easiest way to do this is to handle the BeginExport event of the UltraGridExcelExporter. The event psases you a layout, which is a clone of the grid's DisplayLayout. So you can hide the bands in this layout (using the Hidden property on each band) and it will affect the export, but not the on-screen grid.