Telerik Support,
It seems when you have an ObservableCollection set as the ItemsSource of a RadListView, the RadListView does not like when you set an item in the ObservableCollection using the index of the item.
ex.
ObCollection[i] = newObject;
I get the following exception:
at Android.Runtime.JavaList.get_Item (System.Int32 index) [0x00013]
in
/Users/builder/data/lanes/4009/3a62f1ea/source/xamarin-android/src/Mono.Android/Android.Runtime/JavaList.cs:115
at Telerik.XamarinForms.DataControlsRenderer.Android.ListViewAdapter.UpdateCollectionCore (Telerik.XamarinForms.DataControls.RadListView sourceOwner, Com.Telerik.Widget.List.RadListView targetOwner, System.String propertyName, System.Collections.Specialized.NotifyCollectionChangedEventArgs args) [0x001bd]
in
<65c6ed5e8fb14b688091ad2fdaa0480e>:0
at Telerik.XamarinForms.Common.FacadeAdapterBase`2[S,T].UpdateCollection (System.Object sourceOwner, System.Object targetOwner, System.String propertyName, System.Collections.Specialized.NotifyCollectionChangedEventArgs args) [0x00000]
in
<b09df7d4d5e74454b9482f9e64875b96>:0
at Telerik.XamarinForms.Common.XamarinToNativeControlExtensions.UpdateCollection[T,K] (T nativeElement, K xfЕlement, System.String propertyName, System.Collections.Specialized.NotifyCollectionChangedEventArgs args) [0x00028]
in
<b09df7d4d5e74454b9482f9e64875b96>:0
at Telerik.XamarinForms.DataControlsRenderer.Android.ListViewRenderer.ItemsSource_CollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00011]
in
<65c6ed5e8fb14b688091ad2fdaa0480e>:0
at Telerik.XamarinForms.DataControls.RadListView.OnItemsSourceCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000a]
in
<f0d98fc8921f4f449b0a58a0baeb50d3>:0
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00012]
in
/Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/
class
/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:288
at AlertPSS.Data.APSSObservableItemCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000]
in
<433f2a6adeaf4b85b51b3da650694a41>:0
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object oldItem, System.Object newItem, System.Int32 index) [0x00000]
in
/Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/
class
/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:367
at System.Collections.ObjectModel.ObservableCollection`1[T].SetItem (System.Int32 index, T item) [0x00021]
in
/Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/
class
/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:233
at System.Collections.ObjectModel.Collection`1[T].set_Item (System.Int32 index, T value) [0x00034]
in
/Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/
class
/referencesource/mscorlib/system/collections/objectmodel/collection.cs:57
at AlertPSS.Transcend.AsyncReturns.AddFilteredIncident (AlertPSS.Client.Client.ClientInc inc, System.Boolean isUpdate, System.Boolean isInitial, System.Boolean isPulldown) [0x0060c]
in
C:\Users\kgrub\Documents\Visual Studio 2015\Projects\AlertPSS.Transcend\AlertPSS.Transcend\AsyncReturns.cs:1693
at AlertPSS.Transcend.AsyncReturns+<>c__DisplayClass30_0.<ProcessIncidentUpdate>b__0 () [0x0075a]
in
C:\Users\kgrub\Documents\Visual Studio 2015\Projects\AlertPSS.Transcend\AlertPSS.Transcend\AsyncReturns.cs:1269
This convention is used in WPF/Silverlight to keep a bound collection control ordered correctly instead of removing the item and re-adding it. Should I not be doing it this way in Xamarin?
Please let me know if you need any further information, I am using Telerik For Xamarin 2017 R1 (2017.1.10120.233).
Thanks!