title: How to set a row for editing on a button click in GridView
body: <p>I had a GridView which contains some <code>DataGridTextColumn</code> and one <code>DataGridTemplateColumn</code> which has a button control.</p>
  
  <pre><code>&lt;DataGrid Name="dgProductList" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" AutoGenerateColumns="False"
            RowBackground="{StaticResource MainBackground}" RowHeight="30"
            GridLinesVisibility="None" IsReadOnly="True"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Binding="{Binding Path=Id}" Header="Id" Visibility="Hidden" 
                              FontFamily="verdana"  /&gt;
          &lt;DataGridTextColumn Binding="{Binding Path=Name}" Header="Name" 
                              FontFamily="verdana"/&gt;
          &lt;DataGridTextColumn Binding="{Binding Path=Amount}" Header="Amount" 
                              FontFamily="verdana"  /&gt;
          &lt;DataGridTemplateColumn&gt;
              &lt;DataGridTemplateColumn.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;Button Name="btnEdit" Width="117"  Style="{StaticResource GlossButtonStyle}" 
                              Click="btnEdit_Click" &gt;Edit&lt;/Button&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellTemplate&gt;
          &lt;/DataGridTemplateColumn&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>By default user is not allowed to edit this gridview.</p>
  
  <p><strong>Requirement is</strong></p>
  
  <ol>
  <li><p>When user click the edit button in the row , that particular row only needs to be enabled for editing, rest of the rows should be locked from editing.
  Further on click of that button only editing should be available not on the click of gridview cell.</p></li>
  <li><p>Then that extra row should not be there by default and i had a button outside of grid, on click of that new blank row has to added to the gridview and available in edit mode.</p></li>
  </ol>
  
  <p>I blocked Editing and avoid blank row by using <code>IsReadOnly="True", AutoGenerateColumns="False"</code>. Rest thing i didn't get how to achieve.</p>