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 selection issues #15638

Open
weitzhandler opened this issue Feb 26, 2024 · 1 comment
Open

TreeView selection issues #15638

weitzhandler opened this issue Feb 26, 2024 · 1 comment
Assignees
Labels
area/winui Categorizes an issue or PR as relevant to WinUI difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working waiting-for-winui Denotes an issue which requires support for analogous feature in WinUI.

Comments

@weitzhandler
Copy link
Member

weitzhandler commented Feb 26, 2024

Current behavior

TreeView has some quirks with selection when SelectionMode is set to Multiple when adding items to the SelectedItems collection:

  1. You'd think that the individual TreeViewItem.IsSelected properties are set to true but they're not.
  2. The SelectionChanged event is not fired.

Expected behavior

The 3 selection points of the TreeView should all be synced, and the SelectionChanged should be raised once (not less but not more) for any selection change to any one of them.

  1. SelectedItem/SelectedItems
  2. SelectedNode/SelectedNodes
  3. TreeViewItem.IsSelected

How to reproduce it (as minimally and precisely as possible)

https://github.com/weitzhandler/TreeViewSelectionRepro

Workaround

Traverse entire tree and explicitly set each TreeViewItem.IsSelection individually to desired selection value.

Works on UWP/WinUI

No

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

This is a WinUI issue and has been reported there as well:

microsoft/microsoft-ui-xaml#125
microsoft/microsoft-ui-xaml#5738

@weitzhandler weitzhandler added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Feb 26, 2024
@nickrandolph
Copy link
Contributor

@Youssef1313 Youssef1313 added area/winui Categorizes an issue or PR as relevant to WinUI waiting-for-winui Denotes an issue which requires support for analogous feature in WinUI. labels Feb 26, 2024
@MartinZikmund MartinZikmund added difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/winui Categorizes an issue or PR as relevant to WinUI difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working waiting-for-winui Denotes an issue which requires support for analogous feature in WinUI.
Projects
None yet
Development

No branches or pull requests

4 participants