control in ListView.GridViewColumn alignment

Viewed 11954

I have following WPF ListView:

    <ListView Grid.Column="2" Grid.Row="1" Margin="0,53,12,6" 
Name="lvwProperties" 
ItemsSource="{Binding Path=SelectedPropertyItems, Mode=TwoWay}" 
Grid.ColumnSpan="2">

        <ListView.View >

                        <GridView>
                            <GridViewColumn Header="Property" DisplayMemberBinding="{Binding Path=PropertyName, Mode=TwoWay}" Width="130" />
                            <GridViewColumn Header="Is Mandatory" Width="90"  >

                                <GridViewColumn.CellTemplate>

                                    <DataTemplate>

                                        <CheckBox IsChecked="{Binding Path=IsMandatory, Mode=TwoWay}" HorizontalAlignment="Center" />

                                    </DataTemplate>

                                </GridViewColumn.CellTemplate>

                            </GridViewColumn>

                        </GridView>
                    </ListView.View>
                </ListView>

I want to make the CheckBox aligned center in the 2nd GridColumn. Set the HorizontalAlignment="Center" seems doesn't do the trick. How to achive this in XAML???

1 Answers
Related