title: Remove right click context menu from column headers
body: <p>In my program I have a datagrid which is bound to an observable list. I want to be able to set the context menu to only display when a row is selected so that there wont be errors with nothing being selected. To do this I would like to be able to disable the context menu on the column headers. Here is the XAML:</p>
  
  <pre><code>&lt;DataGrid Name="dgItems" AutoGenerateColumns="False" SelectionMode="Single" SelectionUnit="FullRow" CanUserAddRows="False" IsReadOnly="True"&gt;
    &lt;DataGrid.ContextMenu&gt;
        &lt;ContextMenu&gt;
            &lt;MenuItem Header="Edit Item" Click="EditItem_Click"/&gt;
            &lt;MenuItem Header="Delete Item" Click="DeleteItem_Click"/&gt;
        &lt;/ContextMenu&gt;
    &lt;/DataGrid.ContextMenu&gt;
     &lt;DataGrid.Columns&gt;
        &lt;DataGridTextColumn Header="Caption" Binding="{Binding Caption}"/&gt;
        &lt;DataGridTextColumn Header="Details" Binding="{Binding Details}"/&gt;
        &lt;DataGridTextColumn Header="DateFrom" Binding="{Binding DateFrom}"/&gt;
        &lt;DataGridTextColumn Header="DateTo" Binding="{Binding DateTo}"/&gt;
        &lt;DataGridTextColumn Header="Source" Binding="{Binding Source}"/&gt;
     &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>How would I go about disabling the context menus on the headers? Thanks.</p>