How can we align text of the cell as Horizontally Center Align

Apr 23, 2014 at 9:15 PM
Edited Apr 23, 2014 at 9:20 PM
HI,

How can we align text of the cell as Horizontally Center Align. There is a property called Horizontal Content Alignment but where to apply in DataGrid Generic . Xaml

I had Added the Lines in Style for datagrid cell
<Setter Property="HorixontalContentAlignment" value="Center"/>


But no Success.
Apr 24, 2014 at 7:46 PM
It worked
by applying the Template

<Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type Controls:DataGridCell}">
                <Grid Background="{TemplateBinding Background}">
                    <ContentPresenter VerticalAlignment="Center" />
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
Coordinator
Apr 26, 2014 at 8:16 PM
Good