Bug 25852 - Xamarin.Forms 1.3 ListView does not highlight selected row after refresh
Summary: Xamarin.Forms 1.3 ListView does not highlight selected row after refresh
Status: VERIFIED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-08 18:06 UTC by cdetera@computronsoftware.com
Modified: 2015-02-19 05:45 UTC (History)
5 users (show)

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


Attachments
Simple Project to Replicate this Issue (4.19 MB, application/x-zip-compressed)
2015-01-08 18:06 UTC, cdetera@computronsoftware.com
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:
VERIFIED ANSWERED

Description cdetera@computronsoftware.com 2015-01-08 18:06:14 UTC
Created attachment 9295 [details]
Simple Project to Replicate this Issue

My actual application requires that my ListView's column(s) be dynamic.  When the data (ItemSource) is refreshed part of it is the columns that needs to be displayed.

Using Xamarin.Forms up to the last Stable 1.2 version my application (of course, the approach that I have taken) works as I expected - 
1. I get the data from the our server
2. I create the View (showing the columns that I need to which is part of the data - header) of my ListView
set the ItemSource of the ListView
3. Select the first item of the ListView (programmatically) causing the first row to be highlighted.
4. Refreshing the data goes thru the same process 1-3 and works fine in iOS (8.1) and Android (API 19)

Upgrading to Xamarin.Forms 1.3, in iOS refreshing the data doesn't highlight the first row in the ListView anymore.  Again, the Refresh action goes thru the same process as the initial display.  Only at the initial display that the first row gets highlighted.  Succeeding Refresh of the data DOES NOT.

Note that this works fine (as expected) in Android.

I am attaching a project that will allow you to replicate the issue.  Although it does not dynamically change the columns of the ListView it does show the symptom of the issue.  Here are the following steps that you need to follow to replicate the issue with my notes as to what you need to observe:
1. Load, compile and execute application.  You will notice that the first row of the MasterPage's ListView is highlighted with the DetailPage displaying the Aqua color details.
2. On the MasterPage, Click on the Load/Refresh Button.  Notice that the first row of the MasterPage's ListView is NOT highlighted YET the DetailPage display the Red color details.  This tells me that the first row of the ListView was select.

If you read the code of the MasterDetailPageDemoPage.cs you will see that the initial display and refresh goes thru the same function.  I have added comments on the code but the key code related to the issue got comments in all uppercase.  The code is short enough that it will not be such a nightmare to understand.

Thanks!
Comment 1 asimk 2015-01-09 00:49:48 UTC
I have checked this issue with the help of sample app attached in bug description and getting same behavior. I have checked this issue with iOS and Android both. I observed that when I run app on Android Emulator first row of ListView is selected when I press Refresh Button. But it is not selected in iOS Simulator.

Please refer the screencast for iOS:
http://www.screencast.com/t/mQNarsRJ5w

Please refer the screencast for Android:
http://www.screencast.com/t/jLmbBkTFdzQl

Environment Info:
Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

Xamarin   3.9.236.0 (d6a2cae)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.20.0.34 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.6.0.0 (eb24bdcf5cba2c12b673a07e0a8cce368b9563b3)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

X.iOS:  8.6.0.48
Comment 2 cdetera@computronsoftware.com 2015-01-09 10:19:09 UTC
Do you know if there is a workaround for this?  Or is this something that is simple enough to fix that I should just wait for the next 1.3, non-Apple Unified API support (if there's still going to be any release at this level do let me know)?  Thanks much!
Comment 3 cdetera@computronsoftware.com 2015-01-22 16:32:21 UTC
I have upgraded my application using the Xamarin.Forms 1.3.1 (Apple Unified API) and still the same behavior.  Can you give me a timeline as to when the fix for this is targeted?  Thanks!
Comment 4 cdetera@computronsoftware.com 2015-01-30 16:05:37 UTC
Can you tell me if this is scheduled to be part of the next release?  And if it is can you tell me when the next release is scheduled to be out?  Thanks!
Comment 5 Rui Marinho 2015-02-02 10:07:27 UTC
This is fixed in 1.3.2-pre3
Comment 6 asimk 2015-02-19 05:45:05 UTC
I have checked this issue with Xamarin forms version 1.3.5.6333-pre1 and observed that its working fine hence closing this issue.

Environment Info:
Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.6.00007

Installed Version: Professional

Xamarin   3.10.648.0 (9a9918c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   5.0.0.18 (ef6acfe5ab41bcace97e0f61b83a59cb26d808ba)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.7.2.0 (e507e681c09d1c22474561ca118b62d326a86d72)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified