This following code causes the excel export to fail with "Key not found in Dictionary". I am using build 2041.
private void OnGridBeginExport(object sender, BeginExportEventArgs e) {
e.Layout.Bands[1].Hidden=true; }
What version are you using? Build 2041 of what version?
Can you post more information, such as the call stack of the exception?
Without any more information, by best guess is that your parent band has a formula in it which is referencing the child band, and since the child band does not exist in the exported document, it's failing to resolve the formula properly. To test my theory, you could set the ExportFormulas property on the UltraGridExcelExporter and see if the exception goes away.
NetAdvantage_WinForms_20103.2041_SR is the version.
I tried setting the following but it didn't work.
DataExcelExporter.ExportFormulas = false;//didn't work
Stack trace below...It seems to me that even though I have hidden the child band it is still trying to access the childband columns with there given keys. Then it throws up because it can't do that since I have set Hidden to true. Just a thought.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Infragistics.Win.UltraWinGrid.GridExportCache.GetDocumentBandInfo(UltraGridBand band, PlaceholderType placeHolderType) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.ExportColumnHeaderCells(UltraGridExporterHelper exportHelper, UltraGridRow row, UltraGridBand band, Boolean setRowHeights) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.ProcessHeaderRows(UltraGridExporterHelper exportHelper, UltraGridRow row, UltraGridBand band) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.ProcessGridRowInternal(UltraGridExporterHelper exportHelper, UltraGridRow row, ProcessRowParams processRowParams) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExporterHelper.ProcessRow(UltraGridRow row, ProcessRowParams processRowParams) at Infragistics.Win.UltraWinGrid.RowsCollection.InternalTraverseRowsHelper(IUltraGridExporter exporter) at Infragistics.Win.UltraWinGrid.UltraGrid.Export(IUltraGridExporter exporter) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(UltraGrid grid, Worksheet worksheet, Int32 startRow, Int32 startColumn) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(UltraGrid grid, WorkbookFormat workbookFormat) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(UltraGrid grid, String fileName, WorkbookFormat workbookFormat) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(UltraGrid grid, String fileName)