title: Set Background of Particular DataGrid Cell
body: <p>I am looking to set the background color of a particular cell.  The row is getting selected in the code behind.  The IsSelected property doesn't seem to be working though the cell is getting selected in the code behind with the CurrentCell property of the dataGrid. Only works in form. </p>
  
  <p>XAML:</p>
  
  <pre><code> &lt;Style x:Key="CellStyle" TargetType="{x:Type dg:DataGridCell}"&gt;  
          &lt;Style.Triggers&gt; 
              &lt;Trigger Property="IsSelected" Value="True"&gt;  
                  &lt;Setter Property="Background" Value="Yellow" /&gt; 
              &lt;/Trigger&gt; 
          &lt;/Style.Triggers&gt; 
      &lt;/Style&gt; 
  </code></pre>
  
  <p>Code: </p>
  
  <pre><code>dg.CurrentCell = new DataGridCellInfo(dg.Items[0],dg.Columns[0]);
  
  dg.CellStyle = this.FindResource("CellStyle") as Style;
  </code></pre>