NullReferenceException Updating ObservableCollection for Series

2 posts, 0 answers
  1. Stephen
    Stephen avatar
    20 posts
    Member since:
    Jul 2016

    Posted 20 Jun Link to this post

    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 

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    503 posts

    Posted 21 Jun Link to this post

    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
Back to Top