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

TreeDataGridPresenterBase Replace Regression #265

Open
xLEGiON opened this issue Feb 26, 2024 · 0 comments · May be fixed by #266
Open

TreeDataGridPresenterBase Replace Regression #265

xLEGiON opened this issue Feb 26, 2024 · 0 comments · May be fixed by #266

Comments

@xLEGiON
Copy link

xLEGiON commented Feb 26, 2024

Pull request #241 ported some fixes from AvaloniaUI/Avalonia#13795 to RealizedStackElements, including the new ItemsReplaced method. It also made use of this more efficient method in TreeDataGridPresenterBase when the items collection changed with a NotifyCollectionChangedAction.Replace action.

However, this made the assumption that the old and new items of the NotifyCollectionChangedEventArgs have the same length. When this is not true (e.g. replacing 2 items with 1 or 3 items), the TreeDataGrid does not display the collection change correctly. Before this change to TreeDataGridPresenterBase, the collection change was displayed correctly.

To fix this, it is still possible to use the more efficient ItemsReplaced method when the old and new items have the same length, but use the previous behavior when they do not. I've tested this idea and it fixes the issue. I will create a pull request with the proposed change.

Environment:
TreeDataGrid Version: 11.0.2
Avalonia Version: 11.0.6
Operating System: Windows 10

@xLEGiON xLEGiON linked a pull request Feb 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant