This project is read-only.

DataGridTextColumn VerticalAlignment

Topics: Developer Forum
Mar 3, 2009 at 9:11 PM
I'm trying to center cell content vertically in a DataGridTextColumn.

This works:

<Style x:Key="ElementStyle" TargetType="{x:Type TextBlock}">
 <Setter Property="VerticalAlignment" Value="Center"></Setter>
</Style>

<toolkit:DataGridTextColumn Binding="{Binding Name}" ElementStyle="{StaticResource ElementStyle}" Header="Name">

 

 And this doesn't:

 <Style TargetType="{x:Type toolkit:DataGridTextColumn}" >
 <Setter Property="ElementStyle" Value="{StaticResource ElementStyle}"></Setter>
</Style>

Any idea why? 
Thanks!

 

Chris McKenzie