title: I have a c# WinUI 3 desktop application (VS 2019) - right align text in a datagrid cell
body: <p>Using a datagrid.  I would like to right align certain columns.  The way I tried it below does not work.  Does anyone know the correct way?  Thanks a lot.</p>
  <pre><code>    &lt;Grid Grid.Row=&quot;2&quot; HorizontalAlignment=&quot;Center&quot;&gt;
          &lt;controls:DataGrid x:Name=&quot;Results_DataGrid&quot;  
                         AutoGenerateColumns=&quot;False&quot;
                         CanUserSortColumns=&quot;False&quot;
                         AreRowDetailsFrozen=&quot;True&quot;
                         BorderBrush=&quot;#005986&quot;
                         BorderThickness=&quot;2 2 2 2&quot;
                         Margin=&quot;3 10 3 5&quot;
                         PointerReleased=&quot;Results_DataGrid_PointerReleased&quot;&gt;
              &lt;controls:DataGrid.Columns&gt;
                  &lt;controls:DataGridTextColumn
                          Header=&quot;Jan&quot;
                          Width=&quot;SizeToHeader&quot;
                          Binding=&quot;{Binding Jan}&quot;
                          FontSize=&quot;11&quot;
                          Foreground=&quot;Black&quot; 
                          &gt;
                      **&lt;controls:DataGridTextColumn.ElementStyle&gt;
                          &lt;Style TargetType=&quot;controls:DataGridCell&quot;&gt;
                              &lt;Setter Property=&quot;HorizontalAlignment&quot; Value=&quot;Right&quot;/&gt;
                          &lt;/Style&gt;
                      &lt;/controls:DataGridTextColumn.ElementStyle&gt;**
                  &lt;/controls:DataGridTextColumn&gt;
              &lt;/controls:DataGrid.Columns&gt;
          &lt;/controls:DataGrid&gt;
  </code></pre>