Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picker ‘SelectedIndex’ is not effective #10305

Closed
JusterZhu opened this issue Sep 25, 2022 · 6 comments
Closed

Picker ‘SelectedIndex’ is not effective #10305

JusterZhu opened this issue Sep 25, 2022 · 6 comments
Labels
area-controls-picker Picker platform/windows 🪟 s/duplicate 2️⃣ This issue or pull request already exists s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@JusterZhu
Copy link

Description

When Piker binds a collection or creates Picker.Items, setting SelectedIndex to 0 in xaml does not take effect, and UI has no effect.
image

Steps to Reproduce

XAML:
<StackLayout Margin="0,0,100,0" Grid.Row="7" Orientation="Horizontal" HeightRequest="35" HorizontalOptions="Center"> <Label VerticalOptions="Center" Text="encoding :"></Label> <Picker WidthRequest="400" HeightRequest="30" Margin="9,0,3,0" SelectedIndex="0" ItemsSource="{Binding Encodings}" /> </StackLayout>

C#:
public List<string> Encodings { get { if (_currentEncoding == null) { _encodings = new List<string>(); _encodings.Add("Default"); _encodings.Add("UTF8"); _encodings.Add("UTF7"); _encodings.Add("Unicode"); _encodings.Add("UTF32"); _encodings.Add("BigEndianUnicode"); _encodings.Add("Latin1"); _encodings.Add("ASCII"); } return _encodings; } }

Link to public reproduction project repository

https://github.com/dotnet/maui

Version with bug

6.0.486 (current)

Last version that worked well

6.0.408

Affected platforms

Windows

Affected platform versions

windows10.0.19041

Did you find any workaround?

No response

Relevant log output

No response

@JusterZhu JusterZhu added the t/bug Something isn't working label Sep 25, 2022
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Sep 26, 2022
@jfversluis jfversluis changed the title Picker ‘SelectedIndex ’ is not effective Picker ‘SelectedIndex’ is not effective Sep 26, 2022
@jfversluis jfversluis added the s/needs-repro Attach a solution or code which reproduces the issue label Sep 26, 2022
@ghost
Copy link

ghost commented Sep 26, 2022

Hi @JusterZhu. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@jfversluis
Copy link
Member

You entered the .NET MAUI repository under the reproduction link, please add the right link so we can have a look, thanks!

@JusterZhu
Copy link
Author

You entered the .NET MAUI repository under the reproduction link, please add the right link so we can have a look, thanks!

I don't know how to fill in the correct path. It is not necessary to submit an issue before.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Sep 26, 2022
@akhanalcs
Copy link

akhanalcs commented Sep 26, 2022

Hi @JusterZhu , what @jfversluis meant is that you should provide a link to the code repository which .NET MAUI team can use to run and view your issue.
You can do this by 2 ways (just use one that's convenient for you):
1.Create a new code repository in GitHub, upload your code to it. Grab a link to it and share it in your issue.
2.Zip your code folder, upload here.

Before you share your code, make sure you remove things you can't share with the public.
If that is too much effort, create a new simple .NET MAUI app, include just the code that can be used to demonstrate your issue and share it here.

For an example, just take a look at some other issues where users have shared their code.

@jsuarezruiz jsuarezruiz added the s/duplicate 2️⃣ This issue or pull request already exists label Sep 27, 2022
@jsuarezruiz
Copy link
Contributor

Same or similar to #7138

@JusterZhu
Copy link
Author

Hi @JusterZhu , what @jfversluis meant is that you should provide a link to the code repository which .NET MAUI team can use to run and view your issue. You can do this by 2 ways (just use one that's convenient for you): 1.Create a new code repository in GitHub, upload your code to it. Grab a link to it and share it in your issue. 2.Zip your code folder, upload here.

Before you share your code, make sure you remove things you can't share with the public. If that is too much effort, create a new simple .NET MAUI app, include just the code that can be used to demonstrate your issue and share it here.

For an example, just take a look at some other issues where users have shared their code.

https://github.com/JusterZhu/GeneralUpdate/blob/dev/src/c%23/GeneralUpdate.PacketTool/MainPage.xaml

@ghost ghost locked as resolved and limited conversation to collaborators Oct 28, 2022
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-picker Picker platform/windows 🪟 s/duplicate 2️⃣ This issue or pull request already exists s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants