This is a migrated thread and some comments may be shown as answers.
NullReferenceException Updating ObservableCollection for Series
1 Answer 10 Views
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 20 Jun 2017, 06:32 PM

I just upgraded Telerik UI from v2016.2.708.1 to v2017.2.614.2, and I'm now getting an exception thrown when I try to add a data point to a series. The series is bound to an ObservableCollection, and I can work around the problem by replacing the entire collection when new data is added, but that obviously defeats the purpose of using ObservableCollection.

Has anybody run into this issue? Stack trace follows. Thanks.

====================================================================================

06-20 12:18:53.481 I/MonoDroid( 2065): UNHANDLED EXCEPTION:
06-20 12:18:53.482 I/MonoDroid( 2065): System.NullReferenceException: Object reference not set to an instance of an object.
06-20 12:18:53.482 I/MonoDroid( 2065):   at Telerik.XamarinForms.ChartRenderer.Android.BaseChartRenderer`2[TChart,TNativeChart].Telerik.XamarinForms.Chart.IChartRenderer.OnSeriesSourceCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e, System.Object series) [0x0000c] in <18a6b9b1742b4acca8ea1bef8ca6f563>:0 
06-20 12:18:53.482 I/MonoDroid( 2065):   at Telerik.XamarinForms.Chart.RadCartesianChart.SeriesSource_CollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00009] in <18a6b9b1742b4acca8ea1bef8ca6f563>:0 
06-20 12:18:53.482 I/MonoDroid( 2065):   at (wrapper delegate-invoke) <Module>:invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
06-20 12:18:53.482 I/MonoDroid( 2065):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <a547bd0d78184f26ab08d022f013c1e1>:0 
06-20 12:18:53.482 I/MonoDroid( 2065):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <a547bd0d78184f26ab08d022f013c1e1>:0 
06-20 12:18:53.482 I/MonoDroid( 2065):   at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in <a547bd0d78184f26ab08d022f013c1e1>:0 
06-20 12:18:53.482 I/MonoDroid( 2065):   at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in <3fd174ff54b146228c505f23cf75ce71>:0 

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 21 Jun 2017, 01:42 PM
Hello Stephen,

I was not able to reproduce the behavior you have reported. Please have a look at the attached example and update me whether you are noticing any issues with it. It will be great if you can modify it so that the behavior can be reproduced or share more information on the exact scenario at your end.

Have a great rest of the week.

Regards,
Stefan Nenchev
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Stephen
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or