title: How to make a styled DataGridCheckBoxColumn to respect DataGrid.IsReadonly?
body: <p>I have <code>DataGrid.IsReadonly</code> bound to a property that changes based on a condition.  The <code>DataGrid</code> contains a <code>DataGridCheckBox</code> column that I had to style in order to center it vertically in a cell. </p>
  
  <p>However, after applying a style the check box column does not respect the parent's <code>IsReadonly</code> value.  That is, regardless of its value the <code>checkbox</code> can be clicked on and changed. I've seen quite a number of posts dealing with somewhat similar situations but could not find a reliable solution.  </p>
  
  <p>Could someone please let me know how to style the checkbox column so it respects its parent griddata's IsReadonly?  Any theory behind it would also be appreciated.</p>
  
  <p>This how I apply the style:</p>
  
  <pre><code>&lt;Style x:Key="CenterStyleCB" TargetType="{x:Type CheckBox}"&gt;
        &lt;Setter Property="HorizontalAlignment" Value="Center" /&gt;
        &lt;Setter Property="VerticalAlignment" Value="Center" /&gt;
  &lt;/Style&gt;
  
  &lt;DataGridCheckBoxColumn ...  ElementStyle="{StaticResource CenterStyleCB}" /&gt;
  </code></pre>