Skip to content

Preserve groups collapsed state #122

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ltetak
Copy link
Contributor

@ltetak ltetak commented Mar 10, 2025

This is the same PR as AvaloniaUI/Avalonia#18331

What does the pull request do?

DataGrid has a Grouping behavior. It has a major flaw: when the collection is Reset or just when the DataGrid control is removed and re-attached to the visual tree, it forgets the collapsed state of groups.

What is the current behavior?

Open the Control catalog DataGrid page.
On the Grouping tab collapse some groups.
Switch tabs back and forth.
Groups are expanded again.

What is the updated/expected behavior with this PR?

The state is saved and restored

How was the solution implemented (if it's not obvious)?

I tried to mimick the selection state cache on the same spot.

Breaking changes

none

@ltetak
Copy link
Contributor Author

ltetak commented Mar 11, 2025

I was testing this with more clips and it's not performing great. Especially, it does a lot of work for every collection Reset which is relatively common and cheap in general. I will try to see if there is a better solution.

@MrJul MrJul added the enhancement New feature or request label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants