SelectAll items in WPF datagrid is throwing System.NotSupportedException
<p>I have the following datagrid:</p>

<pre><code>&lt;DataGrid x:Name="dataGridOrderItems" Margin="4,10,2,70"
VerticalGridLinesBrush="LightGray"  HorizontalGridLinesBrush="LightGray" AlternatingRowBackground="Beige"  AlternationCount="2" 
SelectionMode="Single" SelectionUnit="FullRow" 
AutoGenerateColumns="False" IsReadOnly="False" SelectionChanged="dataGridOrderItems_SelectionChanged"&gt;
    &lt;DataGrid.Columns&gt;
        &lt;DataGridTextColumn Header="Resource Id" Binding="{Binding ResourceId}" /&gt;
        &lt;DataGridTextColumn Header="Resource Name" Binding="{Binding DisplayTitle}" /&gt;
        &lt;DataGridTextColumn Header="Quantity" Binding="{Binding Quantity}" /&gt;
        &lt;DataGridTextColumn Header="Type" Binding="{Binding ResourceType}"/&gt;
        &lt;DataGridTextColumn Header="Order Date" Binding="{Binding OrderDate, StringFormat=\{0:d\}}" /&gt;
        &lt;DataGridTemplateColumn Header="Select" CellTemplate="{StaticResource template}"/&gt;
    &lt;/DataGrid.Columns&gt;
    &lt;DataGrid.ContextMenu&gt;
        &lt;ContextMenu &gt;
            &lt;MenuItem Header="Select All" Click="SelectAllDatagridOrderItems"  /&gt;
        &lt;/ContextMenu&gt;
    &lt;/DataGrid.ContextMenu&gt;
&lt;/DataGrid&gt;
</code></pre>

<p>Which is binded to the following data source:</p>

<pre><code>public class CustomerOrdersEntity
{
    public int ResourceId { get; set; }
    public string DisplayTitle { get; set; }

    public int Quantity { get; set; }

    public string ResourceType { get; set; }

    public int OrderId { get; set; }

    public string OrderDate { get; set; }
    public bool IsChecked { get; set; }
}
</code></pre>

<p>I'm attempting to implement a select all item using the following:</p>

<pre><code>public void SelectAllDatagridOrderItems(object sender, RoutedEventArgs e)
{
    if (dataGridOrderItems.ItemsSource == null)
    {
        MessageBox.Show(
            "No resources are currently loaded! Please select a customer to continue.",
            "No resources loaded",
            MessageBoxButton.OK,
            MessageBoxImage.Asterisk);

        return;
    }

    dataGridOrderItems.SelectAll();
}
</code></pre>

<p>However this throws the following exception:</p>

<blockquote>
  <p>An unhandled exception of type 'System.NotSupportedException' occurred
  in PresentationFramework.dll</p>
</blockquote>

<p>How should I approach this? I thought of iterating over the itemsource and updating <code>IsChecked</code> to <code>true</code> for each row but it seemed like unnecessary overkill and I'm sure there must be a more simple solution that I'm missing?</p>