Changing ItemsSource does not update the bound SelectedIndex property, resulting in UI and VM being out of sync

  1. Create an SfPicker and bind the ItemsSource and SelectedIndex to VM properties
  2. Add some items to the ItemsSource VM property collection
  3. Select an item from the picker
  4. Change the ItemsSource by adding a new item at the current SelectedIndex to a copy of the original ItemsSource
  5. Assign the ItemsSource VM property to the updated collection
  6. Open the picker
  7. Observe the SelectedIndex bound property on the VM does not match the visual state of the control in the UI
I cannot provide a sample project as my scenario includes other logic that is not open source, but I am happy to answer questions to help pin down the issue.

6 Replies 1 reply marked as answer

SP Sakthivel Palaniyappan Syncfusion Team May 11, 2021 01:50 PM UTC

Hi Andrew,

Greetings from Syncfusion.

We have analyzed your query and checked the reported issue, but we were unable to reproduce the issue. Sample we tried, which you can download from below link.

Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/PickerSample986735562.zip

Could you please update the following details?

·       Could you please check the issue with the attached sample and let us know whether it is reproduced or not? If the issue was not reproduced in this sample, please revert us by modifying the sample based on your application along with replication procedure or provide the sample.

·       Update which platform you are facing the issue

·       Update Syncfusion NuGet version which you are using in your project.

It will help us to provide better solution at the earliest.

Regards,
Sakthivel P.



AH Andrew Hoke May 11, 2021 04:00 PM UTC

Platform: iOS 14.5
Simulator: iPhone 11
SyncFusion version: 19.1.0.54

I tried updating your sample to more closely match my scenario and the picker would not show. I've attached it regardless.

Attachment: PickerSample986735562_updated_4f8865d6.zip


SP Sakthivel Palaniyappan Syncfusion Team May 13, 2021 02:16 AM UTC

Hi Andrew,

Thanks for the update.

We are currently checking the reported issue in sample level, and we will update the details on or before May 17, 2021. We appreciate your patience until then.

Regards,
Sakthivel P.


SP Sakthivel Palaniyappan Syncfusion Team May 17, 2021 08:40 AM UTC

HI Andrew, 
 
Thanks for your patience. 
 
We have logged bug report on this and please find the feedback portal below. 
 
Bug link: 
https://www.syncfusion.com/feedback/25356/when-inserting-items-based-on-index-new-items-are-not-selected-in-both-android-and  
 
We will fix and provide patch on May 28, 2021. 
 
Regards, 
Sakthivel P. 


SS Suganya Sethuraman Syncfusion Team May 31, 2021 06:09 AM UTC

Hi Andrew,

Thanks for the patience.

We have fixed the reported issue and fix has been included in our tomorrow weekly NuGet release. We will let you know once release has been rolled out.

Regards,
Suganya Sethuraman.
 



SS Suganya Sethuraman Syncfusion Team June 2, 2021 05:15 AM UTC

Hi Andrew,

Thanks for your patience.

We have included the fix in our latest Weekly NuGet release v19.1.0.66 which is available for download (https://www.nuget.org/ ). We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance.

Regards,
Suganya Sethuraman.
 


Marked as answer
Loader.
Up arrow icon