title: How to get a DataGrid column name when the header is clicked, WPF
body: <p>I am trying to determine the column name of a clicked column using the following event handler.</p>
  
  <p>Here is the XAML:</p>
  
  <pre><code>&lt;DataGrid Name ="LoggedGrid" HorizontalAlignment="Left" Margin="-3,288,0,0" VerticalAlignment="Top" Height="198" Width="973"&gt;
      &lt;DataGrid.ColumnHeaderStyle&gt;
          &lt;Style TargetType="DataGridColumnHeader"&gt;
              &lt;EventSetter Event="Click" Handler="columnHeader_Click" /&gt;
          &lt;/Style&gt;
      &lt;/DataGrid.ColumnHeaderStyle&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>And here is the event handler, I cannot figure out how to determine the column name after the column has been clicked, any ideas?</p>
  
  <pre><code>private void columnHeader_Click(object sender, RoutedEventArgs e)
  {
  
  }
  </code></pre>