UWP Community Toolkit, Datagrid control : how to align cell content on the right

Asked

Viewed 16 times

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?

  • @Marcosbrinner, thanks for the comment. The result is the same, all cells on the right.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.