title: Bind to Parent.Parent from DataGridTextColumn.Header
body: <p>hi normally it should work automatically but it doesn't </p>
  
  <p>XAML:</p>
  
  <pre><code> &lt;DataGrid AutoGenerateColumns="False" Width="350" IsReadOnly="True" 
                                ItemsSource="{Binding StichwortList}" &gt;
             &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn Binding="{Binding DisplayName}" Width="350"&gt;
                        &lt;DataGridTextColumn.Header&gt;
                              &lt;DockPanel Margin="0" Width="340" HorizontalAlignment="Stretch" LastChildFill="True"&gt;
                                    &lt;TextBlock DockPanel.Dock="Left" Margin="0" Text="Name"/&gt;
                                    &lt;Button DockPanel.Dock="Right" Content="-" Margin="0" Width="23" Command="{Binding RemoveStichwortCommand}"/&gt;
                                    &lt;Button DockPanel.Dock="Right" Content="+" Margin="0" Width="23" Command="{Binding AddStichwortCommand}"/&gt;
                                    &lt;Label /&gt;
                              &lt;/DockPanel&gt;
                        &lt;/DataGridTextColumn.Header&gt;
                   &lt;/DataGridTextColumn&gt;
             &lt;/DataGrid.Columns&gt;
    &lt;/DataGrid&gt;
  </code></pre>
  
  <p>relevant Code:</p>
  
  <pre><code>        private RelayCommand _addStichwortCommand;
          public ICommand AddStichwortCommand
          {
              get { return _addStichwortCommand ?? (_addStichwortCommand = new RelayCommand(param =&gt; this.OnAddStichwort())); }
          }
  
          private void OnAddStichwort()
          {
              // some code
          }
  
          private RelayCommand _removeStichwortCommand;
          public ICommand RemoveStichwortCommand
          {
              get { return _removeStichwortCommand ?? (_removeStichwortCommand = new RelayCommand(param =&gt; this.OnRemoveStichwort())); }
          }
  private void OnRemoveStichwort()
          {
             // some code
          }
  </code></pre>
  
  <p>my other bindings to this view works and my Command Binding also works fine normally</p>
  
  <p>so could please anyone tell me whats wrong with my binding?</p>
  
  <h2>Edit</h2>
  
  <p>ohh i forgot</p>
  
  <p>it is all in a <code>Usercontrol</code> whose <code>Datacontext</code> contains al the Propertys andfor the Bindings and Commands</p>
  
  <h2>Soultion:</h2>
  
  <p>the <code>DockPanel</code> need to Bind his <code>Datacontext</code> to the <code>Usercontrol</code> <code>Datacontext</code> and the <code>Usercontrol</code> needs a name </p>
  
  <p><code>x:Name="uc"</code></p>
  
  <pre><code>&lt;DockPanel Margin="0" Width="340" HorizontalAlignment="Stretch" LastChildFill="True" DataContext="{Binding ElementName=uc, Path=DataContext}"&gt;
       &lt;TextBlock DockPanel.Dock="Left" Margin="0" Text="Name"/&gt;
       &lt;Button DockPanel.Dock="Right" Content="-" Margin="0" Width="23" Command="{Binding RemoveStichwortCommand}"/&gt;
        &lt;Button DockPanel.Dock="Right" Content="+" Margin="0" Width="23" Command="{Binding AddStichwortCommand}"/&gt;
        &lt;Label /&gt;
  &lt;/DockPanel&gt;
  </code></pre>
  
  <p>if the solution above doesn't work you should take a look on this <a href="https://stackoverflow.com/a/84317/1993545">answer</a></p>