Welcome to the Xamarin.Forms feedback portal. We’re happy you’re here! If you have feedback on how to improve the Xamarin.Forms, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Hi
we have an issue with the SFCombobox. On clearing or modifying the underlying ObservableCollection a NullReferenceException is thrown.
The issue is might be related to the issue of the ticket: https://www.syncfusion.com/forums/reply/148237
The problem occurs with Syncfusion 17.4.039 under Xamarin.Forms 4.4.0.991265
I assembled a demonstration project to reproduce this error.
Regards,
Alexander Köhler
Stacktrace:
System.NullReferenceException
Message=Object reference not set to an instance of an object.
at Syncfusion.Android.ComboBox.SfComboBox.Handle_CollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in
at (wrapper delegate-invoke)
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:263
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionReset () [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:362
at System.Collections.ObjectModel.ObservableCollection`1[T].ClearItems () [0x00018] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:166
at System.Collections.ObjectModel.Collection`1[T].Clear () [0x00014] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Collections/ObjectModel/Collection.cs:81
at SyncFusionComboboxExample.TestViewModel.refillValues () [0x00001] in C:\SFCE\SyncFusionComboboxExample\SyncFusionComboboxExample\MainPage.xaml.cs:55
at Xamarin.Forms.Command+<>c__DisplayClass4_0.<.ctor>b__0 (System.Object o) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Command.cs:74
at Xamarin.Forms.Command.Execute (System.Object parameter) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Command.cs:112
at Xamarin.Forms.ButtonElement.ElementClicked (Xamarin.Forms.VisualElement visualElement, Xamarin.Forms.Internals.IButtonElement ButtonElementManager) [0x00008] in D:\a\1\s\Xamarin.Forms.Core\ButtonElement.cs:60
at Xamarin.Forms.Button.SendClicked () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Button.cs:171
at Xamarin.Forms.Platform.Android.ButtonElementManager.OnClick (Xamarin.Forms.VisualElement element, Xamarin.Forms.IButtonController buttonController, Android.Views.View v) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\ButtonElementManager.cs:25
at Xamarin.Forms.Platform.Android.FastRenderers.ButtonRenderer.Android.Views.View.IOnClickListener.OnClick (Android.Views.View v) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\FastRenderers\ButtonRenderer.cs:71
at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_v) [0x00011] in <11f101b564894ca7af6c482ddc51c698>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.78(intptr,intptr,intptr)