Skip to content

Comments

Fix DataGridColumnHeader not using HeaderTemplate#312

Merged
Kinnara merged 1 commit intoKinnara:masterfrom
klotztech:master
May 28, 2022
Merged

Fix DataGridColumnHeader not using HeaderTemplate#312
Kinnara merged 1 commit intoKinnara:masterfrom
klotztech:master

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