Bug 27779 - Xamarin.Forms.ReadOnlyListAdapter.IndexOf throws NotImplementedExcpetion
Summary: Xamarin.Forms.ReadOnlyListAdapter.IndexOf throws NotImplementedExcpetion
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.5
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Rui Marinho
Depends on:
Reported: 2015-03-09 11:50 UTC by f1177373
Modified: 2015-06-29 07:03 UTC (History)
5 users (show)

Tags: all crash listview
Is this bug a regression?: ---
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 f1177373 2015-03-09 11:50:59 UTC
Setting the property Xamarin.Forms.ListView.SelectedItem causes NotImplemented-Exception if the bound collection does not implement System.Collection.IList. (The used colleciton implements IReadOnlyList<T> which should be enough).

Solution: The implementation of ReadOnlyListAdapter.IndexOf should call the IndexOf-method of the wrapped list instead of throwing a NotImplemented exception.


Following stack was observed:

0x0 in Xamarin.Forms.ReadOnlyListAdapter.IndexOf	C#
 	0xF in Xamarin.Forms.ListProxy.IndexOf	C#
 	0xF in Xamarin.Forms.TemplatedItemsList<Xamarin.Forms.ItemsView<Xamarin.Forms.Cell>,Xamarin.Forms.Cell>.GlobalIndexOfItem	C#
 	0xC in Xamarin.Forms.Platform.Android.ListViewAdapter.SelectItem	C#
 	0x17 in Xamarin.Forms.Platform.Android.ListViewAdapter.OnItemSelected	C#
 	0x1C in Xamarin.Forms.ListView.OnSelectedItemChanged	C#
 	0x115 in Xamarin.Forms.BindableObject.SetValueActual	C#
 	0x1FC in Xamarin.Forms.BindableObject.SetValueCore	C#
 	0x75 in Xamarin.Forms.BindableObject.SetValue	C#
 	0x5 in Xamarin.Forms.BindableObject.SetValue	C#
 	0x7 in Xamarin.Forms.ListView.set_SelectedItem	C#
Comment 1 Rui Marinho 2015-05-19 14:01:39 UTC
Should be fixed in 1.4.3
Comment 4 Parmendra Kumar 2015-06-29 07:03:41 UTC
Thanks @Rui 

I have checked this issue with Xamarin.Forms and its working fine at my end.

Hence closing this issue.