-
Notifications
You must be signed in to change notification settings - Fork 692
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
The TreeView component does not maintain the states of components that have a state such as CheckBox #9657
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you! Open similar issues:
|
I still need help! |
These issues link not fix my issue. |
Faced same problem too. Think it might be related to the item container virtualization. Tried setting the TreeView in ScrollViewer to see if this fixes the problem ? If so, it's related to item reuse again. I also faced to problem when my binding was NOT TwoWay. ?? Why ? have no idea |
@C03lh0 @Al-Caron This is happening because of container virtualization - yes. I think what you want to do here is bind the checkbox to something in your data so that it gets persisted. The containers will be reused, but if it is bound to the data, you should get the value you expect. You will need Two-way binding because when the data changes, you want the UI to reflect it and also when the user clicks the check box, the backing data needs to be updated. |
Describe the bug
Explanation
I created a TreeView that has checkboxes as children. When I check a CheckBox and close the TreeView and open it again, the check goes to another CheckBox.
Steps to reproduce the bug
Here is the code snippet:
Expected behavior
The expected behavior is for the TreeView component to maintain the current state of the CheckBox.
Screenshots
Example Images
Checked second checkbox
Closed and opened TreeView component
NuGet package version
Windows App SDK 1.5.3: 1.5.240428000
Packaging type
Packaged (MSIX)
Windows version
Windows 10 version 22H2 (19045, 2022 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: