-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fixed DataGrid Column Header issues #10912
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
Fixed DataGrid Column Header issues #10912
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes visual issues with the DataGrid column header and its related components by updating the XAML resources and styles used across multiple themes. Key changes include:
- Introducing new resource keys and style definitions for DataGrid column headers and their drop separators.
- Replacing the deprecated DragIndicatorStyle with the DefaultDataGridColumnFloatingHeaderStyle.
- Updating the color and layout settings in theme resource files (Fluent, Fluent.Light, Fluent.HC, Fluent.Dark, etc.) to improve the visual feedback on column header interactions.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
Themes/Fluent.xaml | Updated DataGrid header resources and styles, including new resource keys. |
Themes/Fluent.Light.xaml | Revised DataGrid header styling with new resource references and replaced DragIndicatorStyle. |
Themes/Fluent.HC.xaml | Updated High-Contrast theme resources for DataGrid headers and separators. |
Themes/Fluent.Dark.xaml | Modified dark theme DataGrid styles and resource references accordingly. |
Styles/DataGrid.xaml | Modified template and resource settings for DataGrid column header styles and drag/drop indicator styles. |
Resources/Theme/Light.xaml | Updated brush definitions for DataGrid header backgrounds and borders. |
Resources/Theme/HC.xaml | Adjusted HC resources for DataGrid header elements. |
Resources/Theme/Dark.xaml | Updated dark theme color resources for DataGrid header components. |
Comments suppressed due to low confidence (2)
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.xaml:1443
- Ensure that the deprecation comment for 'DefaultDragIndicatorStyleStyle' is clear and that any references to it throughout the codebase are fully updated to use 'DefaultDataGridColumnFloatingHeaderStyle'.
<!-- Deprecated in .NET 10. Replaced with DefaultDataGridColumnFloatingHeaderStyle resource -->
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/DataGrid.xaml:576
- Confirm that changing the DragIndicatorStyle to use DefaultDataGridColumnFloatingHeaderStyle (via the deprecated style replacement) is intentional and that all consuming components are updated accordingly.
<Setter Property="DragIndicatorStyle" Value="{StaticResource DefaultDragIndicatorStyleStyle}" />
@robert-abeo, I tried ControlFillSecondary/Tertiary color for the header, but the difference in the background of cell and header was very minimal, and it was getting harder to distinguish between them, so I have used SubtleFillColor's here. As I go ahead with the other parts of the DataGrid, I will try to incorporate those in the style. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10912 +/- ##
===========================================
Coverage 2.98812% 2.98812%
===========================================
Files 3320 3320
Lines 664900 664900
Branches 74675 74675
===========================================
Hits 19868 19868
Misses 644851 644851
Partials 181 181
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
@harshit7962, I don't think there is much I can do about that. Take a look at Aero2 DataGrid. And here is the example for the situation you mentioned above : As you can see very little part of the floating drop indicator is being shown here as well. |
Fixes #8678 , #10400
Description
Since, DataGrid in itself is a very complex control with more than half a dozen subcomponents, hence I have decided to divide the fixing of DataGrid style in parts. In this PR, I have taken a stab at fixing the column header and related components. Next I will try to fix select all and row related components in one go and at last data grid cells and data grid as a whole.
For the complete you can take a look here : Restyled DataGrid Control
Here are some screenshots of how the column header will look after the changes :
Customer Impact
Customers will get a better looking datagrid, where the interaction with datagrid column headers will have the correct visual feedback.
Regression
No
Testing
Local app testing.
Risk
Minimal
Microsoft Reviewers: Open in CodeFlow