I am able to center the header without any problems but the cell with the checbox... if I set it to HorizontalAlignment=Center
it shows all the way in the left, if I change it to HorizontalContentAlignemnt=Center
it shows all the way to the right... what am I doing wrong?
<DataGridTemplateColumn Header="Enable?" SortMemberPath="Enable" Width="75">
<DataGridTemplateColumn.HeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
</DataGridTemplateColumn.HeaderStyle>
<DataGridTemplateColumn.CellTemplate >
<DataTemplate >
<CheckBox IsChecked="{Binding Enable, UpdateSourceTrigger=PropertyChanged}">
</CheckBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Activated}" Value="Yes">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTemplateColumn.CellStyle>