title: C# Changing background color of an CustomFieldData event
body: <p>I've got an PivotDataGrid wich is working fine. Also added an CustomUnboundFieldData, but now i want to change the backgroundcolor of the cell according to the value in this field.</p>
  
  <p>To change the color i use a customCellAppearance event. Only this event is fired after i manipulate the values in the unbound field data. </p>
  
  <p>So my question basically is, how to change the background of a cell. Using the unbound field data event? </p>
  
  <p>Below a snippet of the code</p>
  
  <pre><code>//create unbound field
  PivotGridField unboundField = pivot.Control.Fields.Add("unboundDataField", FieldArea.FilterArea);
  unboundField.UnboundType = FieldUnboundColumnType.String;
  
  //fill unbound field with data
  private void Control_CustomUnboundFieldData(object sender, PivotCustomFieldDataEventArgs e)
  {         
  
      String myValue = Convert.ToString(e.GetListSourceColumnValue("sourceColumn"));              
      e.Value = myValue.Substring(6);
      e.Field.SummaryType = FieldSummaryType.Max;            
  } 
  
  //code to change appearance of different cells
  private void Control_CustomCellAppearance(object sender, PivotCustomCellAppearanceEventArgs e)
  {    
      if(e.Value != null)
      {
          e.Background = System.Windows.Media.Brushes.Green; 
      }
  
  }      
  </code></pre>