title: WPF: Two DataGrids, same ItemsSource, One IsReadOnly, Bug?
body: <p>I have a WPF application with two DataGrids that share the same ItemsSource.   When I set one of the DataGrid's IsReadOnly property to true, I lose the ability to add records to the other DataGrid.  I can still edit the contents of the second datagrid, but just cannot add records.</p>
  
  <p>Is this intended?  Is there way around this?   I could use IsEnabled="False" for the DataGrid, but I then lose the ability to scroll in it.</p>
  
  <p>Here is the setup:</p>
  
  <p>XAML:</p>
  
  
  
  <pre class="lang-xaml prettyprint-override"><code>&lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="*" /&gt;
          &lt;RowDefinition Height="*" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;DataGrid Name="dgA" Grid.Row="0" AutoGenerateColumns="False"&gt;
          &lt;DataGrid.Columns&gt;
              &lt;DataGridTextColumn Header="FirstName" Binding="{Binding Path=FirstName}" /&gt;
              &lt;DataGridTextColumn Header="LastName" Binding="{Binding Path=LastName}" /&gt;
          &lt;/DataGrid.Columns&gt;         
      &lt;/DataGrid&gt;
      &lt;DataGrid Name="dgB" Grid.Row="1" AutoGenerateColumns="False" IsReadOnly="True"&gt;
          &lt;DataGrid.Columns&gt;
              &lt;DataGridTextColumn Header="FirstName" Binding="{Binding Path=FirstName}" /&gt;
              &lt;DataGridTextColumn Header="LastName" Binding="{Binding Path=LastName}" /&gt;
          &lt;/DataGrid.Columns&gt;
      &lt;/DataGrid&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>C#:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
  
          List&lt;Person&gt; persons = new List&lt;Person&gt;();
          persons.Add(new Person() { FirstName = "Bob", LastName = "Johnson" });
          persons.Add(new Person() { FirstName = "John", LastName = "Smith" });
  
          dgA.ItemsSource = persons;
          dgB.ItemsSource = persons;
      }
  
      class Person
      {
          public Person() { }
  
          public string FirstName
          {
              get;
              set;
          }
  
          public string LastName
          {
              get;
              set;
          }
      }
  }
  </code></pre>