title: Conditional Formatting of WPF DataGrid Cell Depending on DataType
body: <p>I have a user control that inherits from the WPF DataGrid control and to which I pass different List of objects and, so, the columns of the grid depend (i.e. are automatically generated) on the class of object that I send through. </p>
  
  <pre><code>&lt;userc:cfDataGrid x:Name="grdResults" 
      FontStyle="Normal" 
      FontFamily="Microsoft Sans Serif" 
      FontSize="14" 
      RowHeight="30"  
  
      AutoGenerateColumns="True" 
      Margin="12" 
      AlternatingRowBackground="Gainsboro"  
      AlternationCount="2" 
  
      ItemsSource="{Binding Results}" 
      IsReadOnly="True" 
      HeaderNames="{Binding Headers}" &gt;
  &lt;/userc:cfDataGrid&gt; 
  </code></pre>
  
  <p>Now, I'd like to also pass through a list of objects that have an attribute of SolidColorBrush data type and be able to use this value to set the background colour of the cell rather than display the actual value. </p>
  
  <p>I have not done much work with styles etc and so I wanted to ask if anyone could give me some pointers on how to trap a column with a SolidColorBrush datatype - and perform the action described above - without depending on the name of the column?</p>
  
  <p>Any pointers would be greatly appreciated!</p>
  
  <p>CC</p>