[Scenario Day] Picker SelectedIndex property not working
See original GitHub issueDescription
Picker SelectedIndex property not working.
<Picker Title="Select a monkey"
SelectedIndex="3">
<Picker.Items>
<x:String>Baboon</x:String>
<x:String>Capuchin Monkey</x:String>
<x:String>Blue Monkey</x:String>
<x:String>Squirrel Monkey</x:String>
<x:String>Golden Lion Tamarin</x:String>
<x:String>Howler Monkey</x:String>
<x:String>Japanese Macaque</x:String>
</Picker.Items>
</Picker>
Steps to Reproduce
- Create a new .NET MAUI from template.
- Paste the previous piece of code.
- Launch the App.
Version with bug
Release Candidate 3 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows
Affected platform versions
Windows SDK 10.0.17134.0, Android 11
Did you find any workaround?
No response
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
xamarin picker not binding
Since your Picker 's ItemsSource (TestList property) is of type List<Performance> , the SelectedItem property bound to the Picker must be of ...
Read more >My TwoWay binding for selectedIndex of a Picker doesn't ...
I've got a picker in a page. I've bound its item source and displayItem which both work. However the binding I've made for...
Read more >Picker.SelectedIndex Property (Xamarin.Forms)
Gets or sets the index of the selected item of the picker. This is a bindable property.
Read more >SelectionModel (JavaFX 8)
Refers to the selected index property, which is used to indicate the currently selected index value in the selection model.
Read more >ListPicker - NativeScript Docs
Gets or set the items collection of the ListPicker. The items property can be set to an array or an object defining length...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it’s a matter of declaration order. Xaml respects the order in which you set the properties, and in the snippet the selected index is set before the items, at a time there are no items, and is probably coerced back to 0 or -1.
Verified this on Visual Studio Enterprise 17.6.0 Preview 6.0. Repro on Windows 11 and Android emulator (13.0-API 33) with Project: 7138.zip
Android:
Windows: