title: Ensure only one CheckBox Checked at a time
body: <p>I have WPF data grid which contain two rows with checkboxes:</p>
  
  <pre><code>  &lt;Grid&gt;
       &lt;Grid.ColumnDefinitions&gt;
         &lt;ColumnDefinition Width="*" /&gt;
         &lt;ColumnDefinition Width="3*"/&gt;
       &lt;/Grid.ColumnDefinitions&gt;
       &lt;DataGrid VerticalAlignment="Stretch" 
                 HorizontalAlignment="Stretch"
                 Name="dsGrid"
                 AutoGenerateColumns="False" Grid.Column="1" &gt;
         &lt;DataGrid.Columns&gt;     
           &lt;DataGridTextColumn Header="Properties Name" MinWidth="150" Binding="{Binding Propertie}" /&gt;     
                   &lt;DataGridTemplateColumn Header=" Server " MinWidth="150" &gt;
                       &lt;DataGridTemplateColumn.CellTemplate&gt;
                           &lt;DataTemplate&gt;
                               &lt;StackPanel&gt;
                                   &lt;Grid&gt;
                                      &lt;Grid.ColumnDefinitions&gt;
                                          &lt;ColumnDefinition Width="*" /&gt;
                                          &lt;ColumnDefinition Width="*"/&gt;
                                      &lt;/Grid.ColumnDefinitions&gt;
                                   &lt;TextBlock Name="PropertiesTextBlock" 
                                              HorizontalAlignment="Right" 
                                              VerticalAlignment="Center" 
                                              Text="{Binding Server}"
                                              Grid.Column="1"/&gt;
                                   &lt;CheckBox IsChecked="{Binding                                       Path=IsServerSelected, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                             Checked="Server_Checked" 
                                             VerticalAlignment="Center"
                                             HorizontalAlignment="Left" 
                                             Visibility="{Binding Equal,
                                             Converter={StaticResource BoolToVisibility},FallbackValue=Hidden}" 
                                             Grid.Column="0"/&gt;
                                  &lt;/Grid&gt;     
                               &lt;/StackPanel&gt;
                           &lt;/DataTemplate&gt;
                       &lt;/DataGridTemplateColumn.CellTemplate&gt;
                   &lt;/DataGridTemplateColumn&gt;     
                   &lt;DataGridTemplateColumn Header=" Local " MinWidth="150"&gt;
                       &lt;DataGridTemplateColumn.CellTemplate&gt;
                           &lt;DataTemplate&gt;
                               &lt;StackPanel&gt;
                                   &lt;Grid&gt;
                                       &lt;Grid.ColumnDefinitions&gt;
                                           &lt;ColumnDefinition Width="*" /&gt;
                                           &lt;ColumnDefinition Width="*"/&gt;
                                       &lt;/Grid.ColumnDefinitions&gt;
                                       &lt;TextBlock Name="PropertiesTextBlock" 
                                                  HorizontalAlignment="Right" 
                                                  Text="{Binding Local}" 
                                                  Grid.Column="1"/&gt;
                                       &lt;CheckBox IsChecked="{Binding Path=IsLocalSelected, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                                 Checked="Local_Checked" HorizontalAlignment="Left"
                                                 Visibility="{Binding Equal, Converter={StaticResource BoolToVisibility},FallbackValue=Hidden}"       Grid.Column="0"&gt;&lt;/CheckBox&gt;
                                   &lt;/Grid&gt;
                               &lt;/StackPanel&gt;
                           &lt;/DataTemplate&gt;
                       &lt;/DataGridTemplateColumn.CellTemplate&gt;
                   &lt;/DataGridTemplateColumn&gt;     
               &lt;/DataGrid.Columns&gt;
           &lt;/DataGrid&gt;
           &lt;ListBox HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch"  Name="Entities_List"
                    SelectionChanged="Entities_List_SelectionChanged"
                    SelectionMode="Single"
                    Grid.Column="0"/&gt;
           &lt;Button Content="Merge"
                   Name="Merge_Button"
                   Click="Merge_Button_Click"
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Bottom"
                   Grid.Column="0"  /&gt;
       &lt;/Grid&gt;
  </code></pre>
  
  <p>DataContext ViewModel:</p>
  
  <pre><code>public string Server { get; set; }
  public string Local { get; set; }    
  private bool _pIsServerSelected;
  private bool _pIsLocalSelected;
  
  public bool IsLocalSelected
  {
      get
      {
          return _pIsLocalSelected;
      }
      set
      {
          _pIsLocalSelected = value;
          OnPropertyChanged("IsSelected");
      }
  }
  
  public bool IsServerSelected
  {
      get
      {
          return _pIsServerSelected;
      }
      set
      {
          _pIsServerSelected = value;
          OnPropertyChanged("IsSelected");
      }
  }  
  </code></pre>
  
  <p>My needs are to ensure, that only one Checkbox is checked at a time.
  So if the ServerCheckBox gets checked I want to uncheck the LocalCheckBox.</p>