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

Fix - Grow datagrid height if there's available space #16527

Merged
merged 3 commits into from
Aug 19, 2024
Merged

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Jul 29, 2024

What does the pull request do?

Allows DataGrid to grow vertically with items added, if there's available space. Height can still be constrained by Height and MaxHeight properties, or by parent size.

What is the current behavior?

Currently, DataGrid permanently sets content height on the first row layout pass, to the total height of the rows. If items count increases, a scrollbar appears and extra items are hidden. This occurs even if there's enough space to grow in the parent

What is the updated/expected behavior with this PR?

DataGrid no longer estimates the row cells height, as it's now provided by the parent on measure pass.

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

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #8771

@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 added bug area-datagrid backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Aug 1, 2024
Copy link
Member

@maxkatz6 maxkatz6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching DataGrid tabs breaks rendering for some reason.

image

@avaloniaui-bot
Copy link

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

@avaloniaui-bot
Copy link

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

@grokys grokys added the customer-priority Issue reported by a customer with a support agreement. label Aug 2, 2024
@grokys grokys enabled auto-merge August 2, 2024 09:37
@maxkatz6 maxkatz6 disabled auto-merge August 19, 2024 21:33
@maxkatz6 maxkatz6 merged commit f989fec into master Aug 19, 2024
12 checks passed
@maxkatz6 maxkatz6 deleted the datagrid-grow branch August 19, 2024 21:33
grokys pushed a commit that referenced this pull request Oct 8, 2024
Co-authored-by: Max Katz <maxkatz6@outlook.com>
@grokys grokys added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-datagrid backported-11.1.x bug customer-priority Issue reported by a customer with a support agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datagrid doesn't resize when adding new items
4 participants