I have a grid, where cells contain textblock. I want to add some padding to the text in the cells (to move them inline with the header texts), but it has no effect.
XAML:
<dg2d:DataGrid2DT.CellStyle>
<Style TargetType="wpftoolkit:DataGridCell">
<Setter Property="TextBlock.TextAlignment" Value="Left" />
<Setter Property="TextBlock.Padding" Value="4, 4, 4, 4" />
<Setter Property="TextBlock.VerticalAlignment" Value="Stretch"/>
<Setter Property="TextBlock.HorizontalAlignment" Value="Stretch"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="LightBlue"/>
</Trigger>
</Style.Triggers>
</Style>
</dg2d:DataGrid2DT.CellStyle>
Whatever I set in the padding, it's always the same, see:
Why Padding
does not work here?