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

Custom Thumb Control and ControlTemplate to fix issue #1531 #1542

merged 2 commits into from Dec 5, 2019


Copy link

Jesus805 commented Dec 2, 2019

I created a ControlTemplate (in MaterialDesignGridColumnHeaderGripper) that sets the cursor to SizeWE. This is necessary because the Cursor needs to be explicitly set in ControlTemplate or else the cursor is set to "None" or in some cases disappears in the GridViewColumnHeader.
I also created a Thumb Control to override the cursor when dragging. This is necessary because when dragging, the cursor will revert to "None".

With these changes, a GridView be consistent with the DataGrid control.

…ntrolTemplate for Thumb that sets cursor to SizeWE
@Keboo Keboo self-requested a review Dec 2, 2019
MaterialDesignThemes.Wpf/GridViewColumnThumb.cs Outdated Show resolved Hide resolved
@@ -88,7 +88,7 @@
<ControlTemplate TargetType="GridViewColumnHeader">
<Thumb x:Name="PART_HeaderGripper"
<wpf:GridViewColumnThumb x:Name="PART_HeaderGripper"

This comment has been minimized.

Copy link

Keboo Dec 5, 2019


Rather than changing the MaterialDesignGridColumnHeaderGripper template, lets simply do an explicit style on this element and base it on MaterialDesignGridColumnHeaderGripper and set the template here. This way we won't accidently change any other thumbs that may not be expecting this behavior.

This comment has been minimized.

Copy link

Jesus805 Dec 5, 2019

Author Contributor

I created a new style named MaterialDesignGridViewColumnHeaderGripper. The GridView Gripper does not use <Setter Property="Cursor" Value="SizeWE"/> so I opted to set the base as MaterialDesignThumb

GridViewColumnThumb is now internal.
Created a new style explicitly for the GridView Column.
GridViewColumnHeader now uses this new style.
Keboo approved these changes Dec 5, 2019
Copy link

Keboo left a comment

Awesome thanks

@Keboo Keboo added this to the 3.0.0 milestone Dec 5, 2019
@Keboo Keboo merged commit c1c328b into MaterialDesignInXAML:master Dec 5, 2019
1 check passed
1 check passed
MaterialDesignInXAML.MaterialDesignInXamlToolkit #20191205.1 succeeded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.