列的文本居中
<!--列的文本居中-->
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<DataGrid.ColumnHeaderStyle>
<!--使每一列的头部标题居中-->
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center">
</Setter>
</Style>
</DataGrid.ColumnHeaderStyle>
列的文本居中-需要用ElementStyle 去绑定