Skip to content

DataGrd: Use VisualBrush to generate DragIndicator if Header is a Control. #18154

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

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

rabbitism
Copy link
Contributor

What does the pull request do?

Reusing DataGridColumnHeader content to generate indicator will trigger visual tree exception if content is a control. This PR use similar approach as ComboBox to generate a rectangle with visual brush to avoid this issue.

What is the current behavior?

When column header is a control, reordering the column will crash app with exception Control XX already has a visual parent

What is the updated/expected behavior with this PR?

Can drag as expected.

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

Same as how ComboBox generates SelectionBoxItem.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@rabbitism rabbitism changed the title DataGrd: Use visual brush to generate DragIndicator if Header is a Control. DataGrd: Use VisualBrush to generate DragIndicator if Header is a Control. Feb 9, 2025
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0054854-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added bug area-datagrid backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Feb 15, 2025
@maxkatz6 maxkatz6 merged commit daf3d58 into AvaloniaUI:master Feb 15, 2025
11 checks passed
@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants