title: How to get column reorder working in datagrid
body: <p>I have created a datagrid with a little customization.
  The last column header is made up of the usual textblock plus a stackpanel under it with rotated text.</p>
  
  <p>In order to make it look better I made the first 6 columns 25 in height with vertical alignment at the bottom, otherwise they would have stretched to the top.</p>
  
  <p><img src="https://i.stack.imgur.com/77Rjn.jpg" alt="enter image description here"></p>
  
  <p>My second image shows that I can reorder the last column.
  <img src="https://i.stack.imgur.com/rwRiQ.jpg" alt="enter image description here"></p>
  
  <p>However I can not reorder any of the first six.</p>
  
  <p>In the next pics (Left) I removed the vertical alignment altogether making it sit in the center by default, (Right) I set the vertical alignment to the Top.
  <img src="https://i.stack.imgur.com/PzUZ0.jpg" alt="enter image description here"></p>
  
  <p>As you can see there must be another level of component, you cannot just alter the DataGridColumnHeader style and expect it to be reordered via dragging.</p>
  
  <p><strong>Questions:</strong> </p>
  
  <ul>
  <li>What do I need to add to my style to bring the dragability down to sit with the lower DataGridColumnHeaders at the bottom, as in the first image?</li>
  <li>How do I find this constraint? Can I iterate through the elements of the headers listing them out somehow? </li>
  <li>And lastly the transparent floating dragged image of the column is aligned to the top I would like that brought down to sit at the bottom with the actual header labels, how to do?</li>
  </ul>
  
  <p>Here is my XAML code:</p>
  
  <pre><code>&lt;Window x:Class="DGTest.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="MainWindow" Height="250" Width="500"&gt;
  
      &lt;Window.Resources&gt;
          &lt;Style TargetType="DataGridColumnHeader"&gt;
              &lt;Setter Property="Background" Value="Transparent"/&gt;
          &lt;/Style&gt;
          &lt;Style x:Key="ColumnHeaderStyle" TargetType="DataGridColumnHeader"&gt;
              &lt;Setter Property="Height" Value="25" /&gt;
              &lt;Setter Property="VerticalAlignment" Value="Bottom"/&gt;
          &lt;/Style&gt;
  
      &lt;/Window.Resources&gt;
  
      &lt;Grid Name="gridUsers" Background="Transparent"&gt;
          &lt;DockPanel Background="Transparent"&gt;
              &lt;DataGrid Background="Transparent" CanUserReorderColumns="True" AutoGenerateColumns="False" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"&gt;
                  &lt;DataGrid.Columns&gt;
                      &lt;DataGridTextColumn Header="ID" CanUserReorder="True" IsReadOnly="True" HeaderStyle="{StaticResource ColumnHeaderStyle}" Binding="{Binding Path=User_ID}"/&gt;
                      &lt;DataGridTextColumn Header="Name" CanUserReorder="True" CanUserSort="True" HeaderStyle="{StaticResource ColumnHeaderStyle}" Binding="{Binding Path=Name}"/&gt;
                      &lt;DataGridTextColumn Header="Username" CanUserReorder="True" CanUserSort="True" HeaderStyle="{StaticResource ColumnHeaderStyle}" Binding="{Binding Path=Username}"/&gt;
                      &lt;DataGridTextColumn Header="Job Title" CanUserReorder="True" CanUserSort="True" HeaderStyle="{StaticResource ColumnHeaderStyle}" Binding="{Binding Path=Job_Title}"/&gt;
                      &lt;DataGridTextColumn Header="Department" CanUserReorder="True" CanUserSort="True" HeaderStyle="{StaticResource ColumnHeaderStyle}" Binding="{Binding Path=Department}"/&gt;
                      &lt;DataGridTextColumn Header="Company" CanUserReorder="True" CanUserSort="True" HeaderStyle="{StaticResource ColumnHeaderStyle}" Binding="{Binding Path=Company}"/&gt;
                      &lt;DataGridTemplateColumn CanUserReorder="True" CanUserSort="False" &gt;
                          &lt;DataGridTemplateColumn.Header&gt;
                              &lt;StackPanel Orientation="Vertical" Background="Transparent" HorizontalAlignment="Center"&gt;
                                  &lt;Label Background="AliceBlue" HorizontalAlignment="Stretch" Height="25" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" &gt;
                                      Access
                                  &lt;/Label&gt;
                                  &lt;StackPanel Orientation="Horizontal" Background="Transparent" CanVerticallyScroll="False" CanHorizontallyScroll="False"&gt;
                                      &lt;TextBlock Text="Read" Width="80" Margin="20,1,0,1" &gt;
                                          &lt;TextBlock.LayoutTransform&gt;
                                            &lt;RotateTransform Angle="-60"/&gt;
                                          &lt;/TextBlock.LayoutTransform&gt;
                                      &lt;/TextBlock&gt;
                                      &lt;TextBlock Text="Write" Width="80" Margin="-15,1,0,1" &gt;
                                          &lt;TextBlock.LayoutTransform&gt;
                                            &lt;RotateTransform Angle="-60"/&gt;
                                          &lt;/TextBlock.LayoutTransform&gt;
                                      &lt;/TextBlock&gt;
                                      &lt;TextBlock Text="Administrator" Width="80" Margin="-15,1,0,1" &gt;
                                          &lt;TextBlock.LayoutTransform&gt;
                                            &lt;RotateTransform Angle="-60"/&gt;
                                          &lt;/TextBlock.LayoutTransform&gt;
                                      &lt;/TextBlock&gt;
                                  &lt;/StackPanel&gt;
                              &lt;/StackPanel&gt;
                          &lt;/DataGridTemplateColumn.Header&gt;
                      &lt;/DataGridTemplateColumn&gt;
                  &lt;/DataGrid.Columns&gt;
              &lt;/DataGrid&gt;
          &lt;/DockPanel&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>