1
I have a numerical column in a Datagrid that I want your content to be right aligned. I I read the documentation, chiefly Customizable templates and styling for Cells, Rows and headers where I finished with this code to get the cell content aligned to the 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 actually does what I want, but with all the cells. I want only the numerical column to have that property, and only it, but I have been unable to achieve that.
What am I doing wrong?
Have tried Horizontalcontentalignment?
– Marcos Brinner
@Marcosbrinner, thanks for the comment. The result is the same, all cells on the right.
– João Santana