title: WPF howto click out of rows in DataGrid to unselect item
body: <p>How can I remove selection of Row if I click outside of rows. Like in the red area of the image showing below</p>
  
  <p><img src="https://i.stack.imgur.com/doYtL.png" alt="enter image description here"></p>
  
  <p>The related xaml shows below:</p>
  
  <pre><code>&lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="*" /&gt;
              &lt;RowDefinition Height="auto" /&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;DataGrid x:Name="ClientsList" Grid.Row="0" Grid.Column="0" CanUserAddRows="False"
                    SelectionMode="Extended" SelectionUnit="FullRow"
                    ItemsSource="{Binding ClientItems}" LostFocus="ClientsList_LostFocus" Background="Green"&gt;
          &lt;/DataGrid&gt;
  
          &lt;StackPanel Margin="2" Grid.Row="1" Grid.Column="0" Orientation="Horizontal"&gt;
              &lt;Button x:Name="AddButton"  Margin="2,0,0,0" Content="+" Height="25" Width="40" Click="AddButton_Click"/&gt;
              &lt;Button x:Name="DeleteButton" Margin="2,0,0,0" Content="-" Height="25" Width="40" Click="DeleteButton_Click"/&gt;
          &lt;/StackPanel&gt;
      &lt;/Grid&gt;
  </code></pre>