I recently upgraded my project to use 12.2 dll for my XamDataCharts and now I am getting crashes. Here is the stack trace:
Message :Collection was modified; enumeration operation may not execute.Source :mscorlibStack Trace : at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.List`1.Enumerator.MoveNextRare() at System.Collections.Generic.List`1.Enumerator.MoveNext() at Infragistics.FastItemColumn.get_Maximum() at Infragistics.Controls.Charts.LineSeries.RenderFrame(CategoryFrame frame, CategorySeriesView view) at Infragistics.Controls.Charts.CategorySeries.RenderSeriesOverride(Boolean animate) at Infragistics.Controls.Charts.Series.DoRenderSeries(Boolean animate) at Infragistics.Controls.Charts.ContentInfo.DoRefresh() at Infragistics.Controls.Charts.ChartContentManager.DoRefresh()TargetSite :Void ThrowInvalidOperationException(System.ExceptionResource)
If I revert back to 12.1 I do not see this behavior. I am having difficulties digging into this much further. It could be the way I am updating the collections that the newer version is not allowing anymore. Can you help me figure out if this is a bug in the dll or a bug in the way I am using your dll?
HI,
Are you using a foreach statement, if so try usng a for loop instead.
Sincerely, Matt
Developer Support Engineer
A foreach statement during what operation exactly? Every second I get a list of values and each one needs to be added to a different series collection. I use a foreach to loop through the list of incoming values. Inside that foreach I find the observablecollection I need to add the value to and then I use a dispatcher to add the value to the collection on the UI thread. I am not using a foreach to touch the underlying observablecollection that is bound to the series though.