title: WPF Datagrid-Change background color of the row for which the button is clicked
body: <p>I have a data grid in my wpf application. I wants that when user clicks on any button in the datagrid the corresponding row should be red. I think we can do it by using event trigger but i really don't know how to use it.</p>
  
  <pre><code>    &lt;DataGrid x:Name="dgEmp" Grid.Row="1" AutoGenerateColumns="False" CanUserAddRows="False" &gt;          
          &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Header="Name" Width="*" Binding="{Binding Path=Name}"&gt;&lt;/DataGridTextColumn&gt;
          &lt;DataGridTextColumn Header="Age" Width="*" Binding="{Binding Path=Age}"&gt;&lt;/DataGridTextColumn&gt;
              &lt;DataGridTemplateColumn Header="Delete" Width="*"&gt;
                  &lt;DataGridTemplateColumn.CellTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;Button Content="Delete selected row"&gt;&lt;/Button&gt;                              
                      &lt;/DataTemplate&gt;
                  &lt;/DataGridTemplateColumn.CellTemplate&gt;
              &lt;/DataGridTemplateColumn&gt;
          &lt;/DataGrid.Columns&gt;
      &lt;/DataGrid&gt;
  </code></pre>