title: How to stretch WPF DataGridColumn's header when create?
body: <p>I generate my columns dynamicaly and would like to stretch their headers, like here </p>
  
  <p><img src="https://i.stack.imgur.com/bEsc6.jpg" alt="enter image description here"></p>
  
  <p>In generall the columns can have different names so it is not possible to set a fixed <code>MinWidth</code>. Is it possible through changing the <code>DataGrid.ColumnHeaderStyle</code> to set somehing like horizontal margin for the header text? Here is my XAML:</p>
  
  <pre><code>&lt;DataGrid x:Name="ResultDataGrid" Margin="2"
      ItemsSource="{Binding MyData, Mode=OneWay}"
      DisplayMemberPath="Persons"
      SelectedItem="{Binding SelectedPerson}"
      GridLinesVisibility="None" 
      AutoGenerateColumns="False" 
      CanUserAddRows="False" 
      CanUserDeleteRows="False" 
      CanUserReorderColumns="False"
      IsReadOnly="True"
      SelectionMode="Single"
      AllowDrop="True"&gt;
      &lt;DataGrid.ColumnHeaderStyle&gt;
          &lt;Style TargetType="{x:Type DataGridColumnHeader}"&gt;
              &lt;Setter Property="HorizontalContentAlignment" Value="Center" /&gt;
              &lt;Setter Property="Height" Value="25" /&gt;
              &lt;Setter Property="FontWeight" Value="Black" /&gt;
              &lt;Setter Property="SeparatorBrush" Value="LightGray" /&gt;
          &lt;/Style&gt;
      &lt;/DataGrid.ColumnHeaderStyle&gt;
  &lt;/DataGrid&gt;     
  </code></pre>