Bug 60228 - ArgumentOutOfRangeException when clearing an ObservableCollection bind to a listview and an item is selected
Summary: ArgumentOutOfRangeException when clearing an ObservableCollection bind to a l...
Status: RESOLVED DUPLICATE of bug 59650
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.4.0
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-10-17 13:17 UTC by y.vinee
Modified: 2017-10-23 14:34 UTC (History)
3 users (show)

Tags: listview, clear, ac
Is this bug a regression?: Yes
Last known good build:

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:

Description y.vinee 2017-10-17 13:17:46 UTC
System.ArgumentOutOfRangeException occurred
  Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
   at System.Collections.ObjectModel.Collection`1.Clear()
   at TestObservableCollection.Views.ListViewPage1._Button_Clicked(Object sender, EventArgs e) in D:\Projects\TestObservableCollection\TestObservableCollection\TestObservableCollection\Views\ListViewPage1.xaml.cs:line 46
   at Xamarin.Forms.Button.SendClicked()
   at Xamarin.Forms.Platform.UWP.ButtonRenderer.OnButtonClick(Object sender, RoutedEventArgs e)

The project to reproduce:

Steps to reproduce:
Select an item in the listview.
Click on the button to clear the ObservableCollection binded to the listview
Comment 1 Paul DiPietro [MSFT] 2017-10-19 15:41:22 UTC

*** This bug has been marked as a duplicate of bug 59650 ***
Comment 2 Andreas 2017-10-23 09:23:45 UTC
I'm also facing this bug/issue. When I try to look at the referenced duplicate, I get a message telling i'm not authorized to view the bug 59650. Why?
Comment 3 Paul DiPietro [MSFT] 2017-10-23 14:34:25 UTC
It was marked private and should now be visible.