title: C# WPF - Cannot check/uncheck checkbox in DataGridCheckBoxColumn
body: <p>I´m initializing the <code>DataGrid</code> in <code>XAML</code> but the Columns are generated in the code because columns are varying based on the input data. However when DataGridCheckBoxColumn is generated I cannot check/uncheck the single checkbox in any row of this column. Some of them are checked/unchecked based on the value of bool "checkFlag"
  </p>
  
  <pre><code>DataGridCheckBoxColumn checkColumn = new DataGridCheckBoxColumn();
  checkColumn.Header = "Save";
  checkColumn.Binding = new Binding("checkFlag");
  checkColumn.MinWidth = 50;
  vysledkyDataGrid.Columns.Add(checkColumn);
  
  &lt;DataGrid AutoGenerateColumns="false" 
            Margin="20,247,25,94" 
            Name="vysledkyDataGrid"
            IsEnabled="True" 
            CanUserReorderColumns="False" 
            CanUserResizeColumns="True" 
            CanUserSortColumns="False" 
            HorizontalGridLinesBrush="DarkGray"              
            VerticalGridLinesBrush="DarkGray" 
            ClipboardCopyMode="None" 
            IsReadOnly="True"&gt;
          &lt;DataGrid.ColumnHeaderStyle&gt;
              &lt;Style TargetType="{x:Type DataGridColumnHeader}"&gt;
                  &lt;Setter Property="HorizontalAlignment" Value="Stretch" /&gt;
                  &lt;Setter Property="HorizontalContentAlignment" Value="Center" /&gt;
              &lt;/Style&gt;
          &lt;/DataGrid.ColumnHeaderStyle&gt;
          &lt;DataGrid.CellStyle&gt;
              &lt;Style TargetType="DataGridCell"&gt;
                  &lt;Setter Property="Block.TextAlignment" Value="Right"/&gt;
              &lt;/Style&gt;
          &lt;/DataGrid.CellStyle&gt;
      &lt;/DataGrid&gt;
  </code></pre>