title: WPF - DataGrid Column Header Alignment
body: <p>I'm using the WPFToolkit DataGrid control and I wanted to restyle some of the column headers so that the header text is displayed vertically instead of horizontally (the data in the column is all numeric and therefore, not very wide, but the header text is long).
  So I created a DataTemplate to and tried to get the DataGridColumn.HeaderTemplate to it. This is my template:</p>
  
  <pre><code>&lt;DataTemplate x:Key="headerTemplate"&gt; 
          &lt;StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Left" Background="Aqua"&gt; 
              &lt;StackPanel.LayoutTransform&gt; 
                  &lt;RotateTransform Angle="-90"/&gt; 
              &lt;/StackPanel.LayoutTransform&gt; 
              &lt;TextBlock Text="{Binding}" VerticalAlignment="Bottom" HorizontalAlignment="Left" Background="Pink"&gt; 
              &lt;/TextBlock&gt; 
          &lt;/StackPanel&gt; 
      &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>This works just fine, except the alignment of the header is always left and center. No combination of alignments for the StackPanel or the TextBlock seems to make any difference. I would like to have the text aligned at the bottom and middle. How can I make it do that?</p>
  
  <p>Thanks,</p>
  
  <p>AT</p>