I have a numeric column in a DataGrid that I want your content to be aligned on the right. I read the documentation , especially Customizable templates and styling for cells, rows and headers where I ended up with this code to get the contents of the cell aligned right:
<controls:DataGrid.CellStyle>
<Style TargetType="controls:DataGridCell">
<Style.Setters>
<Setter Property="HorizontalAlignment" Value="Right"/>
</Style.Setters>
</Style>
</controls:DataGrid.CellStyle>
As you might expect, this code really does what I want, but with all cells. I want only the numeric column to have this property, and only it, but I have been unable to achieve this.
What am I doing wrong?