-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
TreeViewItem Template IsExpanded ignored when reused #1790
Comments
This is from a sample I've been working on, I need to publish it, so I can share a full example eventually. This piece is just getting in the way of the core experience for the sample, so I need to figure out a workaround. I actually just noticed even in the initial generation, some of the deeper nodes don't expand, so there may be something else going on even initially as well? |
@kaiguo, can you please take a look ? |
@ranjeshj @kaiguo thinking about this more if it's a timing with the items being loaded from the itemssource, could it be that the isexpanded needs to be updated in the itemssource property changed like the opacity line here too? |
@michael-hawker. Good catch. That is quite possibly what is causing it. Can you try updating isExpanded when ItemsSource changes and see if that fixes the issue ? |
@michael-hawker for testing you can use the nuget package from the PR build artifacts. |
🎉This issue was addressed in #1924, which has now been successfully released as Handy links: |
Describe the bug
I have a dependency property named RootNodes (a List of a hierarchical data type) bound to the TreeView. When I set this property the first time, the tree view populates items from the data structure and all the nodes are expanded as would be expected.
When I set this property again a 2nd time and change the list, the tree view items are regenerated; however, they are now not in an expanded state. They should be in an expanded state.
Steps to reproduce the bug
Steps to reproduce the behavior:
Expected behavior
All TreeViewItems should be expanded as specified in the template.
Screenshots

First time:
Second time:

(Sometimes inconsistent results, e.g. first node will be expanded, but only first node, all other nodes still collapsed, unlike initial behavior.)
Version Info
NuGet package version: Microsoft.UI.XAML 2.3.191211002
The text was updated successfully, but these errors were encountered: