title: Why can't I select cells in my WPF datagrid?
body: <p>I have a WPF datagrid that looks like the following:</p>
  
  <pre><code>&lt;DataGrid x:Name="dataGridOrderItems" Margin="369,0,4,51" VerticalAlignment="Bottom" Height="405" Grid.Row="1"
      VerticalGridLinesBrush="LightGray"  HorizontalGridLinesBrush="LightGray" AlternatingRowBackground="Beige"  AlternationCount="2" SelectionMode="Single" 
      SelectionChanged="dataGridOutstandingOrders_SelectionChanged" AutoGenerateColumns="False" IsReadOnly="True" Grid.ColumnSpan="2"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Header="Resource Name" Binding="{Binding ResourceName}" /&gt;
          &lt;DataGridTextColumn Header="Quantity Ordered" Binding="{Binding Quantity}" /&gt;
          &lt;DataGridTextColumn Header="Order Date" Binding="{Binding OrderDate, StringFormat=\{0:d\}}" /&gt;
          &lt;DataGridCheckBoxColumn Header="Dispatched Resource" Binding="{Binding IsChecked}" /&gt;
          &lt;DataGridTextColumn/&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>Even though the datagrid is enabled and I've specified a selection mode I can't click into any of the cells. What else am I missing?</p>
  
  <p>In case it's relevant, here's the full XAML for the window:</p>
  
  <pre><code>&lt;Window x:Class="OrderProcessor.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
          xmlns:local="clr-namespace:OrderProcessor"
          mc:Ignorable="d"
          Title="Order Processing" Height="727.625" Width="1088" Icon="1438333970_Delivery.ico"&gt;
      &lt;Grid Margin="0,0,2,0"&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="9*"/&gt;
              &lt;ColumnDefinition Width="14*"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="94*"/&gt;
              &lt;RowDefinition Height="315*"/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Button x:Name="buttonRefreshOrders" Content="Load/Refresh Orders List" Margin="0,36,10,0" RenderTransformOrigin="-0.72,-2.65" ToolTip="Click to refresh the orders list with the latest orders from SharePoint" Grid.Column="1" HorizontalAlignment="Right" Width="140" Height="36" VerticalAlignment="Top" Click="buttonRefreshOrders_Click"/&gt;
          &lt;DataGrid x:Name="dataGridOutstandingOrders" Margin="11,7,156,470" RenderTransformOrigin="0.5,0.5" Grid.RowSpan="2" Grid.ColumnSpan="2" VerticalGridLinesBrush="LightGray"  HorizontalGridLinesBrush="LightGray" AlternatingRowBackground="Beige"  AlternationCount="2" SelectionMode="Single" SelectionUnit="FullRow" SelectionChanged="dataGridOutstandingOrders_SelectionChanged" AutoGenerateColumns="False" IsReadOnly="True"&gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn Header="Persona" Binding="{Binding Persona }" /&gt;
                  &lt;DataGridTextColumn Header="Customer Name" Binding="{Binding CustomerName }" /&gt;
                  &lt;DataGridTextColumn Header="Organization" Binding="{Binding Organization }" /&gt;
                  &lt;DataGridTextColumn Header="E-mail" Binding="{Binding Email }" /&gt;
                  &lt;DataGridTextColumn Header="Phone" Binding="{Binding PhoneNumber }" /&gt;
                  &lt;DataGridTextColumn Header="Street" Binding="{Binding Street }" /&gt;
                  &lt;DataGridTextColumn Header="Suburb" Binding="{Binding Suburb }" /&gt;
                  &lt;DataGridTextColumn Header="Postcode" Binding="{Binding Postcode }" /&gt;
                  &lt;DataGridTextColumn Header="Order Date" Binding="{Binding OrderDate , StringFormat={}{0:d}}" /&gt;
  
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
          &lt;Button x:Name="button_Dispatch_Current_Item" Content="Set selected resources to be dispatched" Margin="0,0,10,10" RenderTransformOrigin="-0.72,-2.65" ToolTip="" HorizontalAlignment="Right" Width="462" Grid.Row="1" Grid.Column="1" Height="36" VerticalAlignment="Bottom"/&gt;
          &lt;GroupBox x:Name="groupBoxCustomerDetails" Header="Customer Details" Margin="11,0,0,10" Grid.Row="1"
                    Grid.Column="0" VerticalAlignment="Bottom" Height="455" HorizontalAlignment="Left" Width="353"&gt;
              &lt;StackPanel&gt;
                  &lt;Label x:Name="labelCustomerName" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold"/&gt;
                  &lt;Label x:Name="labelCustomerOrganization" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" /&gt;
                  &lt;Label x:Name="labelCustomerStreet" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" /&gt;
                  &lt;Label x:Name="labelCustomerSuburb" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" /&gt;
                  &lt;Label x:Name="labelCustomerPostcode" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" /&gt;
              &lt;/StackPanel&gt;
          &lt;/GroupBox&gt;
          &lt;DataGrid x:Name="dataGridOrderItems" Margin="369,0,4,51" VerticalAlignment="Bottom" Height="405" RenderTransformOrigin="0.5,0.5" Grid.Row="1"
              VerticalGridLinesBrush="LightGray"  HorizontalGridLinesBrush="LightGray" AlternatingRowBackground="Beige"  AlternationCount="2" SelectionMode="Single" 
              SelectionChanged="dataGridOutstandingOrders_SelectionChanged" AutoGenerateColumns="False" IsReadOnly="True" Grid.ColumnSpan="2"&gt;
              &lt;DataGrid.RenderTransform&gt;
                  &lt;TransformGroup&gt;
                      &lt;ScaleTransform/&gt;
                      &lt;SkewTransform AngleY="-0.146"/&gt;
                      &lt;RotateTransform/&gt;
                      &lt;TranslateTransform Y="-0.497"/&gt;
                  &lt;/TransformGroup&gt;
              &lt;/DataGrid.RenderTransform&gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn Header="Resource Name" Binding="{Binding ResourceName}" /&gt;
                  &lt;DataGridTextColumn Header="Quantity Ordered" Binding="{Binding Quantity}" /&gt;
                  &lt;DataGridTextColumn Header="Order Date" Binding="{Binding OrderDate, StringFormat=\{0:d\}}" /&gt;
                  &lt;DataGridCheckBoxColumn Header="Dispatched Resource" Binding="{Binding IsChecked}" /&gt;
                  &lt;DataGridTextColumn/&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>