Bug 60289 - ListView with Grouping will crash when changing grouping number
Summary: ListView with Grouping will crash when changing grouping number
Status: RESOLVED DUPLICATE of bug 59896
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS (show other bugs)
Version: 2.4.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-20 14:23 UTC by yamachu
Modified: 2017-10-20 15:14 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project (12.78 KB, application/zip)
2017-10-20 14:23 UTC, yamachu
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 59896

Description yamachu 2017-10-20 14:23:22 UTC
Created attachment 25383 [details]
Sample project

We use ListView with attributes HasUnevenRows="true" IsGroupingEnabled="true" and ObservableCollection for ItemSource, application will crash when Group number changed.

System.ArgumentException: Index '3' is greater than the number of rows '2'.
  at Xamarin.Forms.Platform.iOS.ListViewRenderer.UpdateItems (System.Collections.Specialized.NotifyCollectionChangedEventArgs e, System.Int32 section, System.Boolean resetWhenGrouped) [0x00091] in <c95050a8f6d640e8927ac3f95b517dff>:0
  at Xamarin.Forms.Platform.iOS.ListViewRenderer.OnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <c95050a8f6d640e8927ac3f95b517dff>:0
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000a] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\TemplatedItemsList.cs:764
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].OnCollectionChangedGrouped (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x000d5] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\TemplatedItemsList.cs:791
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].OnProxyCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e, System.Boolean fixWindows) [0x00008] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\TemplatedItemsList.cs:968
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].OnProxyCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\TemplatedItemsList.cs:961
  at Xamarin.Forms.ListProxy.OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000a] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\ListProxy.cs:233
  at Xamarin.Forms.ListProxy+<>c__DisplayClass33_0.<OnCollectionChanged>b__0 () [0x00018] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\ListProxy.cs:206
  at Xamarin.Forms.ListProxy.OnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x000a0] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\ListProxy.cs:225
  at Xamarin.Forms.ListProxy+WeakNotifyProxy.OnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00031] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\ListProxy.cs:394
  at System.Collections.ObjectModel.ReadOnlyObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs args) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.84/src/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/readonlyobservablecollection.cs:91
  at System.Collections.ObjectModel.ReadOnlyObservableCollection`1[T].HandleCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.84/src/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/readonlyobservablecollection.cs:145
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.84/src/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:288
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.84/src/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:351
  at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.84/src/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:219
  at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.84/src/mono/mcs/class/referencesource/mscorlib/system/collections/objectmodel/collection.cs:67
  at LabelCrashSample.LabelCrashSamplePageViewModel.<.ctor>b__13_0 () [0x0017b] in /Users/yamachu/Project/Xamarin/LabelCrashSample/LabelCrashSample/LabelCrashSamplePageViewModel.cs:66
  at Xamarin.Forms.Command+<>c__DisplayClass3_0.<.ctor>b__0 (System.Object o) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Command.cs:73
  at Xamarin.Forms.Command.Execute (System.Object parameter) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Command.cs:107
  at Xamarin.Forms.Button.SendClicked () [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Button.cs:116
  at Xamarin.Forms.Platform.iOS.ButtonRenderer.OnButtonTouchUpInside (System.Object sender, System.EventArgs eventArgs) [0x0001b] in <c95050a8f6d640e8927ac3f95b517dff>:0
  at UIKit.UIControlEventProxy.Activated () [0x00007] in /Users/builder/data/lanes/5489/697f665b/source/xamarin-macios/src/UIKit/UIControl.cs:38
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5489/697f665b/source/xamarin-macios/src/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5489/697f665b/source/xamarin-macios/src/UIKit/UIApplication.cs:63
  at LabelCrashSample.iOS.Application.Main (System.String[] args) [0x00001] in /Users/yamachu/Project/Xamarin/LabelCrashSample/iOS/Main.cs:17

When I used Xamarin.Forms 2.3.5.256-pre6, I could not reproduce this issue.
But when I used Xamarin.Forms 2.4.0.282, I could reproduce it.

Here is repo
https://github.com/yamachu/LabelCrashSample

I also had a similar issue(https://bugzilla.xamarin.com/show_bug.cgi?id=59813) in my other project, so I tried to reproduce it. 
But I encountered this issue.
Comment 1 Paul DiPietro [MSFT] 2017-10-20 15:14:32 UTC
Same error as #59896.

*** This bug has been marked as a duplicate of bug 59896 ***