title: DataGridTemplateColumn Two way binding is not working
body: <p>I've got a <code>DataGrid</code> I've bound to a <code>SqlDataApter</code>. If I set up the XAML for the grid using <code>DataTextColumn</code> as illustrated in the code below it works perfectly</p>
  <pre><code>&lt;DataGrid AutoGenerateColumns=&quot;False&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;27,42,0,0&quot;
            Name=&quot;dataGrid1&quot; VerticalAlignment=&quot;Top&quot; AreRowDetailsFrozen=&quot;True&quot;&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding KEY}&quot; Visibility=&quot;Hidden&quot;
                              IsReadOnly=&quot;True&quot;/&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding CHARACTERISTIC_CODE}&quot;
                              Header=&quot;Unit&quot; IsReadOnly=&quot;True&quot;/&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding UNIT_CHAR}&quot;
                              Header=&quot;Unit&quot; IsReadOnly=&quot;True&quot; /&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding IC_DEF_CHAR_NUMERIC}&quot;
                              Header=&quot;Number&quot; IsReadOnly=&quot;False&quot;/&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding IC_DEF_CHAR_TEXT}&quot;
                              Header=&quot;Text&quot; IsReadOnly=&quot;False&quot; /&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding IsNumeric}&quot;
                              Header=&quot;Status&quot; IsReadOnly=&quot;True&quot;/&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding IsText}&quot;
                              Header=&quot;Status&quot; IsReadOnly=&quot;True&quot;/&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  <p>I am binding this to a <code>DataTable</code> in code using:</p>
  <pre><code>dataGrid1.ItemsSource = dTable.DefaultView
  </code></pre>
  <p>And I have a button that saves the changes using the ذSqlDataAdapterذ update method:</p>
  <pre><code>dAdapter.Update(dTable)
  </code></pre>
  <p>The problem is that I want to disable editing the <code>IC_DEF_CHAR_TEXT</code> field when the record <code>isNumeri</code>c and the <code>IC_DEF_CHAR_TEXT</code> when the record <code>IsText</code>. I tried binding to the <code>IsReadOnly</code> property but found that it is not bind-able, so I created templates for the two fields and bound the <code>IsEnabled</code> property to the <code>IsText</code> and <code>IsNumeric</code> fields.</p>
  <pre><code>&lt;DataGrid AutoGenerateColumns=&quot;False&quot; HorizontalAlignment=&quot;Left&quot;
            Margin=&quot;27,42,0,0&quot; Name=&quot;dataGrid1&quot; VerticalAlignment=&quot;Top&quot; 
            AreRowDetailsFrozen=&quot;True&quot;&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding KEY}&quot; Visibility=&quot;Hidden&quot;
                              IsReadOnly=&quot;True&quot;/&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding CHARACTERISTIC_CODE}&quot;
                              Header=&quot;Unit&quot; IsReadOnly=&quot;True&quot;/&gt;
          &lt;DataGridTextColumn Binding=&quot;{Binding UNIT_CHAR}&quot;
                              Header=&quot;Unit&quot; IsReadOnly=&quot;True&quot;/&gt;
          &lt;DataGridTemplateColumn Header=&quot;Numeric&quot;&gt;
              &lt;DataGridTemplateColumn.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBox Text=&quot;{Binding Path=IC_DEF_CHAR_NUMERIC,
                               Mode=TwoWay}&quot;/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellTemplate&gt;
              &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBox IsReadOnly=&quot;False&quot;
                               Text=&quot;{Binding Path=IC_DEF_CHAR_NUMERIC,
                               Mode=TwoWay,
                               UpdateSourceTrigger=PropertyChanged}&quot;/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
          &lt;/DataGridTemplateColumn&gt;
          &lt;DataGridTemplateColumn Header=&quot;Text&quot; &gt;
              &lt;DataGridTemplateColumn.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBox Text=&quot;{Binding Path=IC_DEF_CHAR_TEXT,
                               Mode=TwoWay}&quot;/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellTemplate&gt;
              &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBox Text=&quot;{Binding Path=IC_DEF_CHAR_TEXT,
                               Mode=TwoWay,
                               UpdateSourceTrigger=PropertyChanged}&quot;/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
          &lt;/DataGridTemplateColumn&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  <p>This worked exactly like I wanted,  the textboxes were enabled when necessary. However the changes made in the <code>TextBoxes</code> are no longer saved to the database during update.  Can someone out there explain to me why the database is no longer being updated?</p>