I have a WPF DataGrid with a column header as follows:
<DataGridTemplateColumn Header="Length" Width="100">
...
</DataGridTemplateColumn>
How do I make this header align right? Thanks. I know how to align the column content. Emphasis is aligning COLUMN HEADER.
Set the HorizontalContentAlignment
of the header using the HeaderStyle
:
<DataGridTemplateColumn.HeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Right"/>
</Style>
</DataGridTemplateColumn.HeaderStyle>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With