This is a migrated thread and some comments may be shown as answers.

Collection was modified; enumeration operation may not execute

1 Answer 186 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 14 Aug 2017, 02:45 AM

I have an application that is extremely close to your ChartView Live data demo.  The only real difference is that my data is being fed by the query results of a service and my chart exists in a user control, not the main window.  The results are provided back to me in a KeyValue pair list, which I then loop through and parse to get the actual values I need.  This in turn is added to a private collection.  The chart's collection is a public collection, which is supposed to call and get the private collection.  I say supposed to, because at the moment that piece does not work.  I can run the code and everything work just fine with no errors, but the moment I bind the data source in the chart's XAML file, I start getting the collection modified error.  If I remove the binding, everything runs perfect.  I'm currently using UI for WPF R2 2017 SP1.

Is there an actual live data demo where the data is being fed by the results of a query on a timer interval that I can refer to?  Everything I have seen thus far are embedded random number generators, which are not realistic in my situation.  Thanks.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 16 Aug 2017, 03:22 PM
Hello Chris,

No, there is no live data example with data fetched from a data service or a similar source. We are not aware of the reported issue but the approach used in the Live Data example should be sufficient also with a service. 

Can you elaborate a bit more on your case by sending me some runnable code snippets demonstrating how you fetch the data and how the chart is populated and updated? Alternatively, you can open a new support ticket from your telerik.com account and attach a runnable project there. This will help me test this on my side and investigate what happens.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ChartView
Asked by
Chris
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or