I think it's depends on panel who is filled or docked in datagrid horizontal content alignment doesn't work
for center content alignment you can use DataGrid.resource tag like this
<DataGrid.Resources>
<Style TargetType="DataGridCell">
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
</DataGrid.Resources>
or see this one
<DataGrid x:Name="DgvUsers" AutoGenerateColumns="False" IsReadOnly="True" EnableRowVirtualization="False"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center" HeadersVisibility="Column"
IsTextSearchEnabled="True" FlowDirection="RightToLeft" SelectionMode="Single" FontFamily="/Sandogh.App;component/Font/#Lalezar" >
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTextColumn Header="UserID" Visibility="Collapsed" Binding="{Binding Path=UserID}"/>
<DataGridTextColumn Header="FirstName" Binding="{Binding Path=Name}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="LastName" Binding="{Binding Path=Family}"/>
<DataGridTextColumn Header="Gender" Binding="{Binding Path=TGender}"/>
<DataGridTextColumn Header="UserName" Binding="{Binding Path=UserName}"/>
<DataGridTextColumn Header="Password" Binding="{Binding Path=Password}"/>
<DataGridTextColumn Header="Activity" Binding="{Binding Path=TActivity}"/>
<DataGridTextColumn Header="JobID" Visibility="Collapsed" Binding="{Binding Path=JobID}"/>
<DataGridTextColumn Header="JobName" Binding="{Binding Path=JobName}"/>
</DataGrid.Columns>
</DataGrid>