title: DataGridTemplateColumn Styling for Disabled Controls WPF
body: <p>I have a <code>DataGrid</code> control in my WPF application, and I have a checkbox column as one of the columns.  I am using a <code>DataGridTemplate</code> to build the data grid.  My goal is to change the background color of any checkbox data grid cell where the checkbox is disabled.  My checkbox column looks like this:</p>
  
  <pre><code>&lt;!-- style for the checkbox column cells --&gt;
  &lt;Style x:Key="DefaultCheckboxCellStyle" TargetType="DataGridCell"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type DataGridCell}"&gt;
                  &lt;Grid Background="{TemplateBinding Background}"&gt;
                      &lt;ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /&gt;
                  &lt;/Grid&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
      &lt;Style.Triggers&gt;
          &lt;Trigger Property="IsEnabled" Value="True"&gt;
              &lt;Setter Property="Background" Value="HotPink" /&gt;
          &lt;/Trigger&gt;
      &lt;/Style.Triggers&gt;
  &lt;/Style&gt;
  
  ...
  &lt;DataGridTemplateColumn Header="MyCheckBoxColumn" CellStyle="{StaticResource DefaultCheckboxCellStyle}"&gt;
      &lt;DataGridTemplateColumn.CellTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;CheckBox Name="chk" IsChecked="{Binding MyChkChecked, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=MyChkEnabled}" /&gt;
          &lt;/DataTemplate&gt;
      &lt;/DataGridTemplateColumn.CellTemplate&gt;
  &lt;/DataGridTemplateColumn&gt;
  ...
  </code></pre>
  
  <p>Nothing I am doing seems to change the cell background for disabled checkboxes.  I am displaying disabled checkboxes, but all of the cells themselves are still enabled.  Is there a way to bind the enabled value from the inner checkbox control to the cell?  If so, I could use that in my trigger.</p>
  
  <p>Many thanks!</p>