Bug 33870 - crash when the listview selection is disabled on Windows Phone 8.1 RT
Summary: crash when the listview selection is disabled on Windows Phone 8.1 RT
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 1.5.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Samantha Houts [MSFT]
Depends on:
Reported: 2015-09-10 23:23 UTC by Erik Renaud
Modified: 2016-01-27 13:42 UTC (History)
7 users (show)

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

Reproduction (140.08 KB, application/x-zip-compressed)
2015-11-23 14:15 UTC, Anonymous

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 Erik Renaud 2015-09-10 23:23:42 UTC
My windows phone 8.1 rt app crashed when I deactivate a listview's selection as specified in :

Here is my code :
        public void OnItemSelected(object sender, SelectedItemChangedEventArgs args)
                ((ListView)sender).SelectedItem = null;

Here is the code that prevents crashing, it is a hack though :

        public void OnItemSelected(object sender, SelectedItemChangedEventArgs args)
            if (Device.OS != TargetPlatform.Windows) //hack to prevent the app from crashing
                ((ListView)sender).SelectedItem = null;

Here is the exception information :
    Exception: {"Value does not fall within the expected range."}
    Handled: false
    Message: "System.ArgumentException: Value does not fall within the expected range.\r\n   at Windows.UI.Xaml.Controls.Primitives.Selector.put_SelectedIndex(Int32 value)\r\n   at Xamarin.Forms.Platform.WinRT.ListViewRenderer.OnElementItemSelected(Object sender, SelectedItemChangedEventArgs e)\r\n   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)\r\n   at Xamarin.Forms.ListView.OnSelectedItemChanged(BindableObject bindable, Object oldValue, Object newValue)\r\n   at Xamarin.Forms.BindableObject.SetValueActual(Bindabl"
    Native View: 0x09196568 <Information not available, no symbols loaded for Windows.UI.Xaml.dll>
Comment 1 Paul DiPietro [MSFT] 2015-09-11 14:16:46 UTC
Could you please provide a reproduction project which causes this bug? At the moment I am unable to reproduce the issue in either an 8.0 or 8.1 project using the above line of code. I am using Forms 1.5.0-pre3. It would be of help to the team in investigating this issue.
Comment 2 Erik Renaud 2015-09-11 14:40:25 UTC
Have you tried a Windows Phone 8.1 RT app ? or just the Windows Sylverlight ?
Comment 3 Shane 2015-10-18 18:22:06 UTC
Hi try this


The SL projects works but the RT project does not...

In my actual project 
-I select an item
-navigate to a details page for that item
-then navigate back (it navigates back to a cached page)
-At this point I'm finding it impossible to clear the Selected ITem from the ListView :-(  I just keep getting exceptions or it won't clear
Comment 4 Anonymous 2015-11-17 16:24:37 UTC
For me this is only happening in ListViews with Grouping enabled. Is that the case for you Shane?
Comment 5 Anonymous 2015-11-17 16:56:25 UTC
I can reproduce on a Windows 8.1 Store App as well. The key to reproducing this issue seems to lie in enabling grouping in the listview. Can someone at Xamarin confirm this issue?
Comment 6 Anonymous 2015-11-23 14:15:23 UTC
Created attachment 13937 [details]

I have attached a reproduction of this bug for both Windows Phone and Windows Store App. The issue seems to be fixed for Windows Phone in Xamarin.Forms 2.0, however the bug still exists for Windows Store Apps.
Comment 7 Tom 2015-12-16 20:52:33 UTC
I am also having this issue with Windows Phone 8.1 Listview with Grouping enabled. I'm using Forms
Comment 9 Rui Marinho 2016-01-04 20:04:42 UTC
Should be fixed in 2.0.2-pre1.
Comment 10 Rui Marinho 2016-01-20 12:13:09 UTC
Correction should be fixed in 2.1.0-pre1.
Comment 11 Parmendra Kumar 2016-01-27 13:42:08 UTC
I have checked this issue with Xamarin.Forms and now its working fine.

Hence closing this issue.