title: WPF DataGrid CheckBox Select All And Get Selected Rows
body: <p>I have a Datagrid in WPF. I added a checkbox column as follows:</p>
  
  <pre><code>    &lt;DataGridTemplateColumn&gt;
       &lt;DataGridTemplateColumn.Header&gt;
         &lt;CheckBox Name="CheckALL"  IsChecked="{Binding IsCheckedAll, Mode=TwoWay,  UpdateSourceTrigger=PropertyChanged}" /&gt;
       &lt;/DataGridTemplateColumn.Header&gt;
       &lt;DataGridTemplateColumn.CellTemplate&gt;
         &lt;DataTemplate&gt;
            &lt;CheckBox Name="chkSelect" IsChecked="{Binding IsSelected, Mode=TwoWay,  UpdateSourceTrigger=PropertyChanged}"/&gt;
         &lt;/DataTemplate&gt;
       &lt;/DataGridTemplateColumn.CellTemplate&gt;
   &lt;/DataGridTemplateColumn&gt;
  </code></pre>
  
  <p>Now property changed event gets fired on check box in rows is clicked, But I also want to get all check boxes checked when header check box is clicked. </p>
  
  <p>When Header check box is clicked, All checkboxes are selected when i write code like this:</p>
  
  <pre><code>&lt;DataTemplate&gt;
   &lt;CheckBox Name="chkSelect" IsChecked="{Binding IsChecked, Mode=OneWay, ElementName=CheckALL,  UpdateSourceTrigger=PropertyChanged}"/&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>But at the same time both functions are to be obtained.
  Please help me</p>