I am using Infragistics4.Documents.Excel.v11.2 to create an excel spreadsheet. I am able to load all of the data correctly. I then go to format the sheet and set the font. Using this code:
'Sheet is already populated
Dim sheet As Worksheet
For Each row as WorksheetRow in sheet.Rows
For Each cell as WorksheetCell in row.Cells
cell.CellFormat.Font.Name = "Trebuchet MS"
Next
As I'm processing the second row, the cell Next statement throws the exception:
Collection was modified after the enumerator was instantiated.
Stack Trace:
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.SortedList`2.Enumerator.MoveNext()
at Infragistics.Documents.Excel.WorksheetRow.<GetCellsWithData>d__a.MoveNext()
at Infragistics.Documents.Excel.WorksheetCellCollection.<GetEnumeratorHelper>d__0.MoveNext()
at ConsoleApplication1.Module1.Main()
Any ideas what is causing this error to be thrown?
Hello,
I try to reproduce your issue in a small sample, but without success. Could you please take a look at the attached sample and video file and please feel free to modify this sample to reproduce your issue and revert it back to me. I`ll be glad to research your issue. Also please tell me do you have any installed service release and which one.
Let me know if you have any questions.
Regards
HI,
Have you been able to resolve your issue ? Did you have a time ot take a look at th eattached sample. Let me know if you have any questions.
I've included a sample application here that will throw the error when run. I load the data into a worksheet from a .csv file then apply the font using the code from my first post. The error is thrown at the end of the first row.
Let me know if you need any other information.
Hello Braro,
Thanks for attached sample. Could you please tell me what is your current version and do you have any installed service release. I try to reproduce your issue using your sample with version 11.2 and latest available service release - 11.2.20112.2062 and eveything works properly. Could you please take a look at the attached video.
Please note that you could download the latest available service release from our site: Infragistics.com -> My IG -> My Keys and Downloads.
Hello Brad,
You could used our public service release NetAdvantage_WinForms_20112.2050_SR. Meanwhile (at May 11 ) we publish a new SR - 20112.2074.
Please let me know if you have any questions.
Hi Georgi,
I am unable to download the 2062 service release. I went to Infagistics.com -> My IG -> My Keys and Downloads. Under the NetAdvantage tab I selected NetAdvantage Ultimate 2011 Vol. 2, then scrolled down to Service Releases. I selected NetAdvantage for Windows Forms 2011 Vol. 2 - Windows Forms Service Release and downloaded it.
The file I downloaded was NetAdvantage_WinForms_20112.2050_SR, from 3/6/12. Has 2062 not been released yet?
Brad