Dear all,
I have the ultragrid with several bands so that I want to expand all when I export it into excel using UltraGridExcelExporter. How to do it in the coding when before below command run?? set any properties??
ultraGridExcelExporter.Export(reportList, ws, i + 1, 0);
private void ultraGridExcelExporter1_ExportEnding(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.ExportEndingEventArgs e) { foreach (WorksheetRow row in e.CurrentWorksheet.Rows) { row.Hidden = false; } }
I am getting error in foreach loop while using your code to expand all rows.
I am using UltraGridExcelExporter control of Infragistics 2006 Vol 2.
What's the error?
On what line of code does it occur?
Can you post a sample the reproduces it so I can check it out?
I have attached an image but unfortunately it is not showing with my previous post.
Getting error in forach loop,
"foreach statement cannot operate on variables of type 'Infragistics.Excel.WorksheetRowCollection' because 'Infragistics.Excel.WorksheetRowCollection' does not contain a public definition for 'GetEnumerator'"
Another error is : 'Infragistics.Excel.WorksheetRowCollection' does not contain a definition for 'Hidden'
Please find attached screenshots for more detail.
There's no reason I can imagine why this code would work for me and not for you. The Rows collection clearly DOES have an enumerator. Unless maybe you are using some really old version, or the objects in your code are not actually the same ones defined in the Infragistics Excel library.
Can you reproduce this exception in a small sample project and post it here?
From which version of UltraGridExcelExporter control has Enumeration?
I don't have that version available to test with. The older version I have is 8.1 and that version works fine. I find it very unlikely that there was ever a time that this class didn't have an enumerator on it, but I suppose it's possible.