WPF DataGrid: How to set content alignment of RowHeader to 'Center'

Posted by Nike on Stack Overflow See other posts from Stack Overflow or by Nike
Published on 2010-03-20T14:52:03Z Indexed on 2010/03/20 18:51 UTC
Read the original article Hit count: 224

Filed under:
|
|

I use WPF DataGrid. I put a text value in RowHeader and want to set alignment of RowHeader content to 'Center'. I tried this:

<toolkit:DataGrid.RowHeaderStyle>
   <Style TargetType="{x:Type toolkit:Primitives.DataGridRowHeader}">
       <Setter Property="HorizontalAlignment" Value="Center"/>
       <Setter Property="HorizontalContentAlignment" Value="Center"/>
   </Style>
</toolkit:DataGrid.RowHeaderStyle>

but it doesn't work.

Actually I think that there is TextBlock in RowHeader and I need to set its TextAlignment Property to Center. How can do it?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about datagrid