We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

NullReferenceException when reloading ObservableCollection<T>

Good Day,

We have experienced something weird on the DataGrid when we try to reload the data inside the item source thru ObservableCollection. The app throws this exception which is something we don't understand why. The issue we encountered was with v14.4.0.15 and v14.4.0.20; On the previous version, we didn't experienced this kind of error.

Please help us ASAP!

Thank you.

See below this is the exception that was thrown by the application;

01-30 14:07:11.243 I/MonoDroid(14942): System.NullReferenceException: Object reference not set to an instance of an object.
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.Platform.Android.VisualElementPackager.RemoveChild (Xamarin.Forms.VisualElement view) [0x00014] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:139 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.Platform.Android.VisualElementPackager.OnChildRemoved (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x0000f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:125 
01-30 14:07:11.243 I/MonoDroid(14942):   at (wrapper delegate-invoke) System.EventHandler`1[Xamarin.Forms.ElementEventArgs]:invoke_void_object_TEventArgs (object,Xamarin.Forms.ElementEventArgs)
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.Element.OnChildRemoved (Xamarin.Forms.Element child) [0x0000f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Element.cs:356 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.VisualElement.OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\VisualElement.cs:577 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.Layout`1[T].OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:39 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.Layout.OnInternalRemoved (Xamarin.Forms.View view) [0x00012] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:412 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:376 
01-30 14:07:11.243 I/MonoDroid(14942):   at (wrapper delegate-invoke) <Module>:invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
01-30 14:07:11.243 I/MonoDroid(14942):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00012] in /Users/builder/data/lanes/3511/501e63ce/source/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:288 
01-30 14:07:11.243 I/MonoDroid(14942):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00000] in /Users/builder/data/lanes/3511/501e63ce/source/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:351 
01-30 14:07:11.243 I/MonoDroid(14942):   at System.Collections.ObjectModel.ObservableCollection`1[T].RemoveItem (System.Int32 index) [0x0002b] in /Users/builder/data/lanes/3511/501e63ce/source/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:205 
01-30 14:07:11.243 I/MonoDroid(14942):   at System.Collections.ObjectModel.Collection`1[T].Remove (T item) [0x0002d] in /Users/builder/data/lanes/3511/501e63ce/source/mono/mcs/class/referencesource/mscorlib/system/collections/objectmodel/collection.cs:113 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.ObservableWrapper`2[TTrack,TRestrict].Clear () [0x00030] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\ObservableWrapper.cs:45 
01-30 14:07:11.243 I/MonoDroid(14942):   at Syncfusion.SfDataGrid.XForms.VisualContainer.OnItemsSourceChanged () [0x00014] in <0e18c3999f324e928a6ea83b75eca1f0>:0 
01-30 14:07:11.243 I/MonoDroid(14942):   at Syncfusion.SfDataGrid.XForms.SfDataGrid.OnItemsSourceChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x000ce] in <0e18c3999f324e928a6ea83b75eca1f0>:0 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.BindableObject+SetValueFlags attributes, System.Boolean silent) [0x00108] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindableObject.cs:584 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0014b] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindableObject.cs:378 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x0020c] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindingExpression.cs:177 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindingExpression.cs:55 
01-30 14:07:11.243 I/MonoDroid(14942):   at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__44_0 () [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindingExpression.cs:475 
01-30 14:07:11.243 I/MonoDroid(14942):   at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/3511/501e63ce/source/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36 
01-30 14:07:11.243 I/MonoDroid(14942):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3511/501e63ce/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Java.Lang.IRunnable.cs:81 
01-30 14:07:11.243 I/MonoDroid(14942):   at (wrapper dynamic-method) System.Object:c285725e-01d0-4700-bd9d-1c0fd756cb81 (intptr,intptr)



1 Reply

AN Ashok N Syncfusion Team January 31, 2017 07:07 PM UTC

Hi Joseph, 
 
Thanks for contacting Syncfusion support. 
 
We are able to reproduce the reported NullReferenceException and we are updated the details in your below mentioned incident, Please refer that incident for further updates.  
 
Regards, 
Ashok 


Loader.
Live Chat Icon For mobile
Up arrow icon