title: wpf bind checkbox command inside DataGridTemplateColumn.CellTemplate
body: <p>This has been asked several times with different variations but I can't get any of them to work.</p>
  
  <p>I'm trying to get a method called in my viewmodel when a checkbox (in a datagridTemplateColumn.cellTemplate) is clicked in my view</p>
  
  <pre><code>&lt;DataGrid ItemsSource="{Binding TransactionTypes}" AutoGenerateColumns="False" CanUserAddRows="False" x:Name="TransTypesGrid"&gt;
  &lt;DataGrid.Columns&gt;
      &lt;DataGridTemplateColumn&gt;
          &lt;DataGridTemplateColumn.CellTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                              Command="{Binding DataContext.UpdateCommand, ElementName=TransTypesGrid}" /&gt;
              &lt;/DataTemplate&gt;
          &lt;/DataGridTemplateColumn.CellTemplate&gt;
      &lt;/DataGridTemplateColumn&gt;
      &lt;DataGridTextColumn Header="Transaction Type" Binding="{Binding TransTypeDesc}" /&gt;
  &lt;/DataGrid.Columns&gt;
  </code></pre>
  
  <p></p>
  
  <p>and in my viewModel</p>
  
  <pre><code>public DelegateCommand UpdateCommand { get; set; }
  
  public myConstructor()
  {    
    this.UpdateCommand = new DelegateCommand(Update);
  }
  
  private void Update()
  {
      //this stuff works, it's just not getting called when a checkbox get's (un)checked
      //stuff that goes though the DataGrid's item source's IsSelected property
  }
  </code></pre>