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

TreeView SelectedItems is always zero if SelectionMode is SingleItem #124

Closed
jverral opened this issue Dec 20, 2018 · 12 comments · Fixed by #243
Closed

TreeView SelectedItems is always zero if SelectionMode is SingleItem #124

jverral opened this issue Dec 20, 2018 · 12 comments · Fixed by #243
Labels
area-TreeView bug Something isn't working team-Controls Issue for the Controls team

Comments

@jverral
Copy link

jverral commented Dec 20, 2018

If I have a TreeView, if it's set to SingleItem for it's selection mode, than it's SelectedItems is always zero, even when I clearly have something selected.

@limefrogyank
Copy link

Yes, and you can't even manually add nodes to the SelectedItems collection. It is always empty. (You seem to be able to manually add them when SelectionMode = Multiple )

@jevansaks jevansaks added bug Something isn't working area-TreeView labels Dec 24, 2018
@jevansaks
Copy link
Member

Thanks for the report! Our team is on holiday break right now but we'll investigate when we return.

@jevansaks
Copy link
Member

@kaiguo can you take a look at this when you're done with 19H1 bugs?

@kaiguo
Copy link
Contributor

kaiguo commented Jan 24, 2019

@jevansaks I saw there's a related issue #197. Should we just add a SelectedNode property to be consistent with ListView?

@jevansaks
Copy link
Member

Yeah, that was my thinking. Now technically the other issue was asking for a SelectedItem not SelectedNode. Should we also be offering a SelectedItem and SelectedItems properties to help with the databinding scenarios?

@kaiguo
Copy link
Contributor

kaiguo commented Jan 24, 2019

Yeah, I'll add SelectedItem and SelectedItems too.

@predavid-zz
Copy link

We'd need SelectedItem as well as SelectedNode. @kaiguo - I believe you are in the process of adding both.

@kaiguo
Copy link
Contributor

kaiguo commented Jan 29, 2019 via email

@predavid-zz
Copy link

Great Progress! Thanks @kaiguo

@msft-github-bot
Copy link
Collaborator

🎉This issue was addressed in #243, which has now been successfully released as Microsoft.UI.Xaml v2.2.190731001-prerelease.:tada:

Handy links:

@jevansaks jevansaks added the team-Controls Issue for the Controls team label Nov 7, 2019
@GrandArth
Copy link

May i ask how can i apply the new version to a uwp project? It seems this problem still exist in UWP (6.2.12)

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Feb 18, 2021
@StephenLPeters
Copy link
Contributor

Download and import our Nuget package into your project! We have instructions here: https://github.com/microsoft/microsoft-ui-xaml#using-winui

@ghost ghost removed the needs-triage Issue needs to be triaged by the area owners label Feb 19, 2021
@StephenLPeters StephenLPeters added the needs-triage Issue needs to be triaged by the area owners label Feb 19, 2021
@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TreeView bug Something isn't working team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants