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 DataGridColumnHeader not using HeaderTemplate #312

Merged
merged 1 commit into from
May 28, 2022

Conversation

klotztech
Copy link
Contributor

Hi,
thanks for this awesome library!
I've come to notice, that the DataGrid style overrides the use of my column's HeaderTemplate.

Example

<DataGrid>
    <DataGrid.Columns>
        <DataGridTemplateColumn Header="Header!">
            <DataGridTemplateColumn.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="Template!" />
                </DataTemplate>
            </DataGridTemplateColumn.HeaderTemplate>
        </DataGridTemplateColumn>
    </DataGrid.Columns>
</DataGrid>

Actual Output

image

Expected Output

image

Proposed Solution

It came down to the ContentTemplate of the DataGridColumnHeader's ContentPresenter not being passed down.
Change required: Use provided HeaderTemplate for DataGridColumnHeader's ContentPresenter

Hope this helps :)
cheers

… column's HeaderTemplate

Use provided HeaderTemplate for DataGridColumnHeader's ContentPresenter
@Kinnara Kinnara merged commit 48167bf into Kinnara:master May 28, 2022
@Kinnara
Copy link
Owner

Kinnara commented May 28, 2022

Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants