title: Adding a checkbox-column to a WPF-datagrid which is linked to a datatable
body: <p>I have a problem adding a checkbox-column to a WPF-datagrid.</p>
  
  <ol>
  <li>I create a datatable with 8 columns and fill it using sql.</li>
  <li><p>I bind the datatable to the WPF-datagrid using ItemsSource like:</p>
  
  <p>XAML:</p>
  
  <p><code>&lt;DataGrid x:Name="dgOPListEntries" Grid.Row="1" Grid.ColumnSpan="2" Margin="5" ItemsSource="{Binding}" AutoGenerateColumns="True"&gt;&lt;/DataGrid&gt;</code></p>
  
  <p>CodeBehind:</p>
  
  <p><code>dgOPListEntries.ItemsSource = dtOPListEntries.DefaultView;</code></p></li>
  </ol>
  
  <p>So far, this works fine.</p>
  
  <p>I now want to add a checkbox-column to the datagrid where I can select some rows.
  (The selected rows will then be updated on the sql server.)</p>
  
  <p>Any help is appreciated.</p>