Picker does not update when it's underlying list changes content. This is tested with XF UWP (haven't tried Android or iOS).
UPDATE 10/23 8:51PM: Just tried on Android, and not seeing the issue on that platform.
SO Post complete with source code at...
https://stackoverflow.com/questions/58528033/xamarin-forms-cant-update-picker
Runnable source code at...
https://github.com/JohnLivermore/SampleXamarinApp/tree/upgradeAnimals
I have 2 controls both bound to the same list. One a Picker the other a CollectionView. As the underlying ItemSource is updated, the controls should stay in sync. They do not.
I have 2 controls both bound to the same list. One a Picker the other a CollectionView. When the list is updated, the CollectionView gets the change, but the Picker does not.
I think this is related to 4.3.0.908675. 4.2.0.778463 does not have this issue and works fine.
https://github.com/JohnLivermore/SampleXamarinApp/tree/upgradeAnimals
I verified this by adding a change items button inside the Xamarin Forms repository Control Gallery app on the Picker view gallery.
The Picker class has a method to handle ItemsSource changes, but does no longer notify the PickerRenderer class that it needs to update the native control...
I think all platforms are affected, but I only checked UWP and did a possible solution PR for it.
Guess needs discussion!
Confirmed - works fine on Android/iOS, not so much on UWP.
I have a similar issue as this when testing on Android.
Since upgrading Xamarin.Forms - you no longer seem to be able to update the picker list by using .AddRange/.Add/.Remove
Designing the code in the same way as mentioned in the original bug report does seem to work on Android but not when using the above actions. These did used to work in an older version of Xamarin.Forms.
I also run into this issue and need to revert to 4.2.0.910310
Causing problems for a production app for me to.
This issue is holding up a product release on my end as well. The picker seems to work fine if the call to populate occurs synchronous to the main thread, but as my request to populate occurs asynchronously, no elements are included in the picker. It works fine on Android but not on UWP.
Hi @samhouts . UWP is still performing differently than Android w/ XF. 4.3.0.947036
I see that this issue has been moved to Done in vCurrent. We should expect another 4.3.0.x update soon or it should be under 4.3.0.947036 ?
Thanks
This should be in the 4.3.0 service release 2, which is planned for release this week!
ok, 4.3.0 service release 2 works, I can click/tap it, but now the size of my picker is small when I add it to a grid row, so I can't see which entry I have selected, no matter how large I set the <RowDefinition.Height>
for the grid row that contains the picker.
In 4.2.0.910310
picker looks good:
anyone else with this issue?
Yes there is a spurious TextBlock on top of the picker.
Yeah that will be fixed with : https://github.com/xamarin/Xamarin.Forms/pull/8160
ok, hopefully this PR gets merged soon
It doesn't appear this has been resolved yet. I just encountered a failure of the Picker to be refreshed when new Items are added to it. Any word on when this'll be fixed?
It doesn't appear this has been resolved yet.
I no longer see it with XF 4.5, which version do you use?
Most helpful comment
Yeah that will be fixed with : https://github.com/xamarin/Xamarin.Forms/pull/8160