Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How I can align the Column header of DataGrid to center in DataGrid of WPF. I prefer to set it using XAML

thanks in advance

Iqbal
Posted

1 solution

This block might help you:

<pre lang="HTML">
...
<DataGridTextColumn Header="Nombre"
Binding="{Binding Nombre}">
<DataGridTextColumn.HeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment"
Value="Center" />
</Style>
</DataGridTextColumn.HeaderStyle>
...
</pre>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900