- Home
- Forum
- Xamarin.Forms
- When removing the last item from the collection I get an unhandled exception
When removing the last item from the collection I get an unhandled exception
11-11 12:20:32.495 I/MonoDroid( 8992): UNHANDLED EXCEPTION:
11-11 12:20:32.498 I/MonoDroid( 8992): System.ArgumentOutOfRangeException: 0 out of range 0 to -1
11-11 12:20:32.498 I/MonoDroid( 8992): Parameter name: from
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.GridCommon.ScrollAxis.DistanceRangeCounterCollection.CheckRange (System.String paramName, System.Int32 from, System.Int32 to, System.Int32 actualValue) [0x00046] in <d219f7643cf94391ad5e330cc3382e52>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.GridCommon.ScrollAxis.DistanceRangeCounterCollection.SetRange (System.Int32 from, System.Int32 to, System.Double distance) [0x0000d] in <d219f7643cf94391ad5e330cc3382e52>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.GridCommon.ScrollAxis.DistancesUtil.DistancesLineSizeChanged (Syncfusion.GridCommon.ScrollAxis.IDistanceCounterCollection distances, Syncfusion.GridCommon.ScrollAxis.ILineSizeHost linesHost, System.Int32 from, System.Int32 to) [0x0002b] in <d219f7643cf94391ad5e330cc3382e52>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.GridCommon.ScrollAxis.DistancesUtil.DistancesLineHiddenChanged (Syncfusion.GridCommon.ScrollAxis.IDistanceCounterCollection distances, Syncfusion.GridCommon.ScrollAxis.ILineSizeHost linesHost, System.Int32 from, System.Int32 to) [0x00042] in <d219f7643cf94391ad5e330cc3382e52>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.GridCommon.ScrollAxis.LineSizeCollection.SetRange (System.Int32 from, System.Int32 to, System.Double size) [0x0002d] in <d219f7643cf94391ad5e330cc3382e52>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.ListView.XForms.GridLayout.SetRowHeightForDynamicChange (System.Int32 rowIndex, Syncfusion.ListView.XForms.GridViewRowInfo rowInfo, System.Double itemSpacing) [0x00038] in <0115031071984eb2a7a3af75b153d05c>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.ListView.XForms.GridLayout.UpdateListViewItemSize (Syncfusion.ListView.XForms.ListViewItemInfoBase itemInfo) [0x0006a] in <0115031071984eb2a7a3af75b153d05c>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.ListView.XForms.ListViewItem.OnChildMeasureInvalidated () [0x00073] in <0115031071984eb2a7a3af75b153d05c>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.Layout.OnChildMeasureInvalidated (System.Object sender, System.EventArgs e) [0x00020] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:213
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.VisualElement.InvalidateMeasureInternal (Xamarin.Forms.Internals.InvalidationTrigger trigger) [0x0000b] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:836
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.Layout.OnChildMeasureInvalidated (Xamarin.Forms.VisualElement child, Xamarin.Forms.Internals.InvalidationTrigger trigger) [0x00090] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:355
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.Layout.OnChildMeasureInvalidated (System.Object sender, System.EventArgs e) [0x00013] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:212
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.VisualElement.InvalidateMeasureInternal (Xamarin.Forms.Internals.InvalidationTrigger trigger) [0x0000b] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:836
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.Layout.OnChildMeasureInvalidated (Xamarin.Forms.VisualElement child, Xamarin.Forms.Internals.InvalidationTrigger trigger) [0x00090] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:355
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.Layout.OnChildMeasureInvalidated (System.Object sender, System.EventArgs e) [0x00013] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:212
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.VisualElement.InvalidateMeasureInternal (Xamarin.Forms.Internals.InvalidationTrigger trigger) [0x0000b] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:836
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.Layout.InvalidateLayout () [0x00007] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:202
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.Layout.OnInternalRemoved (Xamarin.Forms.View view) [0x00022] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:466
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002b] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:427
11-11 12:20:32.498 I/MonoDroid( 8992): 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
11-11 12:20:32.498 I/MonoDroid( 8992): at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:338
11-11 12:20:32.498 I/MonoDroid( 8992): at System.Collections.ObjectModel.ObservableCollection`1[T].RemoveItem (System.Int32 index) [0x00021] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:182
11-11 12:20:32.498 I/MonoDroid( 8992): at System.Collections.ObjectModel.Collection`1[T].RemoveAt (System.Int32 index) [0x00027] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Collections/ObjectModel/Collection.cs:144
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.TemplateUtilities.OnContentChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00018] in D:\a\1\s\Xamarin.Forms.Core\TemplateUtilities.cs:63
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:624
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00179] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:422
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:572
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:122
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.ContentView.set_Content (Xamarin.Forms.View value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\ContentView.cs:11
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.XForms.Shimmer.SfShimmer.OnIsActivePropertyChanged (System.Object oldValue, System.Object newValue) [0x0001f] in <4c03acefcda64295b1ec5940f6db2dd0>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Syncfusion.XForms.Shimmer.SfShimmer.OnIsActivePropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x0000a] in <4c03acefcda64295b1ec5940f6db2dd0>:0
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:624
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00179] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:422
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00220] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:167
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:57
11-11 12:20:32.498 I/MonoDroid( 8992): at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__49_0 () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:618
11-11 12:20:32.498 I/MonoDroid( 8992): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in /Users/runner/runners/2.159.2/work/1/s/src/Mono.Android/Java.Lang/Thread.cs:36
11-11 12:20:32.498 I/MonoDroid( 8992): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/runner/runners/2.159.2/work/1/s/src/Mono.Android/obj/Release/android-28/mcw/Java.Lang.IRunnable.cs:81
11-11 12:20:32.498 I/MonoDroid( 8992): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.51(intptr,intptr)
SIGN IN To post a reply.
10 Replies
MI
Michael
November 11, 2019 02:18 PM UTC
This problem now only occured when introducing the sfshimmer on item level.
if I remove the shimmer from the item the process works without issues.
GP
Gnana Priya Namasivayam
Syncfusion Team
November 12, 2019 01:26 PM UTC
Hi Michael,
Thanks for using Syncfusion products.
We have checked by implementing the reported behavior by loading shimmer inside the Listview's ItemTemplate from our side. We would like to inform you that our sample works fine without any crash. We have tested in the latest ListView version 17.3.0.14 and above and Xamarin v4.3.0.9470. We have also attached the tested sample for your reference, please find the sample from the following link.
Can you please check with the above sample whether the reported issue occurs in our sample also. If not please revert us back with the issue replicated or modified sample so that we can analyze your query better and provide an appropriate solution at our end.
Regards,
Gnana Priya N
MI
Michael
November 13, 2019 12:11 PM UTC
Thank You for the reply.
I was able to resolve the problem in my scenario by changing the AutoFitMode="DynamicHeight" to AutoFitMode="Height".
SP
Subburaj Pandian Veluchamy
Syncfusion Team
November 14, 2019 06:52 AM UTC
Hi Michael,
Thank you for the update. We are happy that the reported issue resolved at your end.
Even though, while setting AutoFitMode="DynamicHeight” issue could not occur. Can you please modify the provided sample based on your scenario and revert to us, It will be helpful for us to check on it and provide you the appropriate solution.
Regards,
Subburaj Pandian V
Subburaj Pandian V
MI
Michael
November 14, 2019 08:03 PM UTC
Hi spent some time to recreate the scenario I have with your example.
Attachment: Monkeys_bb0f879c.rar
When you look at the two listviews they are currently set to DynamicHeight.
If you click all the monkey in list one they will be moved to the second list.
When removing the last listitem the exception is thrown.
This does NOT happen when the autofitmode is set to HEight, but then the listitem doesn't look right.
This is exactly the behaviour I have in my app now :(
Attachment: Monkeys_bb0f879c.rar
GP
Gnana Priya Namasivayam
Syncfusion Team
November 15, 2019 02:02 PM UTC
Hi Michael,
We have checked the attached sample from our side and we could able to reproduce the reported issue when AutoFitMode as DynamicHeight but when AutoFitMode as Height sample throws Null reference exception from Image converter. We suspect it is the sample level issue and validating the attached sample. But when setting AutoFitMode as Height also which is not working, If possible, please share the runnable sample when AutoFitMode as Height.
Meanwhile, we are validating the given sample from our side. We will check and provide you with further updates on or before November 19, 2019. We will appreciate your patience until then.
Regards,
Gnana Priya N
GP
Gnana Priya Namasivayam
Syncfusion Team
November 20, 2019 05:21 PM UTC
Hi Michael,
We have checked your sample regarding the reported issue “System argument exception throws while moving the last item from one SfListView to another when AutoFitMode as DynamicHeight” from our side. The reported issue occurs while handling IsLoaded property of Shimmer control after adding the last item to another SfListView. Currently, we are checking the reported issue with both the ListView and Shimmer control. We will validate and update further details on or before November 22, 2019.
We will appreciate your patience until then.
Regards,
Gnana Priya N
SP
Subburaj Pandian Veluchamy
Syncfusion Team
November 22, 2019 01:02 PM UTC
Hi Michael,
Thank you for your patience.
We have analyzed and we confirmed the reported issue “Throws unhandled exception When removing the last item from the ListView collection with DynamicHeight AutoFitmode” is a bug and logged a defect report for the same. We will fix this issue and include the issue fix in our upcoming Volume 4 beta release which is estimated to be available by first week of December 2019. We appreciate your patience until then.
You can track the status of this report through the following feedback link,
Note: The provided feedback link is private, you need to login to view this feedback.
Regards,
Subburaj Pandian V
Subburaj Pandian V
MI
Michael
November 22, 2019 02:07 PM UTC
Thank you!
GP
Gnana Priya Namasivayam
Syncfusion Team
November 25, 2019 06:12 AM UTC
Hi Michael,
Thanks you for the update.
We will let you know once the reported issue ”Throws unhandled exception When removing the last item from the ListView collection with DynamicHeight AutoFitmode” is fixed and included in 2019 Volume 4 beta release.
Regards,
Gnana Priya N
SIGN IN To post a reply.
- 10 Replies
- 3 Participants
-
MI Michael
- Nov 11, 2019 11:23 AM UTC
- Nov 25, 2019 06:12 AM UTC