Hi,
How can i exclude some of the Grid columns to export, when exporting UltraGrid data in excel.
Use the BeginExport event on the UltraGridExcelExporter. This event will pass you a Layout, which is a clone of the grid layout. Since it's a clone, you can make changes to this layout and it will not affect the on-screen grid, only the export. So you can hide columns or band, change colors, or anything else you like.
Hi Mike,
If there are two bands but I only want band[0] to export, how can I make that happen?
thanks
-Ken
Yes, I tried that but the Excel Exporter throws an error stating a key isn't found. I assume it is still trying to use the Band[1] column keys during export.
I am going to try this to see if I can get around it.
private void OnInitializeRowDataExcelExporter(object sender, ExcelExportInitializeRowEventArgs e) { e.SkipDescendants = SkipChildBandExcelExport; }
Hi, you can hide the Band in BeginExport event of UltraGridExporter
like this
private void OnGridBeginExport(object sender, BeginExportEventArgs e) { e.Layout.Bands[1].Hidden=true; }