Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Column virtualization in DataGrid with GroupStyle hides column headers when empty #10779

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
cbra-caa opened this issue Apr 16, 2025 · 0 comments
Labels
Investigate Requires further investigation by the WPF team.

Comments

@cbra-caa
Copy link

Description

Based on the following discussion: #10774

The problem is that when a DataGrid with a group style, but without any initial rows is rendered, the column headers are does not show.
After an initial set of rows has been added the headers display as expected, even if the rows are cleared again.

The problem reappears if the ItemsSource is changed causing grouping to be reapplied. This is f.ex. the case when running with a mvvm structure where the datagrid hosts different content based on a folder structure.

Reproduction Steps

Setup:

  • All columns in my DataGrid have a set width
  • EnableColumnVirtualization is set to true
  • A groupstyle has been added to the datagrid.

DataGridColumnVirtualization.zip

  1. Run the program 'as is', observe that no column headers are rendered
  2. Add an item through the context menu, column headers appear
  3. Remove the item again, column headers stay

Expected behavior

I would expect the column headers to be initially rendered, as they do so when no GroupStyle is present

Actual behavior

No column headers are shown initially

Regression?

Not that I know of

Known Workarounds

Deferring the GroupStyle till after items has been added seems to fix the problem, see #10774 (reply in thread)

Impact

Reduces the usability of the datagrid for complex data structures where multiple columns and groupings are needed to give an overview.

Configuration

.NET Framework 4.8
Windows 11 Pro, v26100.3775
64-bit operating system, x64-based processor

Other information

No response

@siagupta0202 siagupta0202 added the Investigate Requires further investigation by the WPF team. label Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team.
Projects
None yet
Development

No branches or pull requests

2 participants