title: WPF - Binding multiple values to a datagrind
body: <p><strong>UPDATED</strong> : Clean subject, and summarize it.</p>
  
  <p>Hi,
  I've a datable filled, where each cell is a class like this</p>
  
  <pre><code>class CValue{
       public object Value;
       public Brush Quality;
       private int m_quality;
  
       public override String toString(){
             return Value.toString();
       }
  }
  </code></pre>
  
  <p>My datagrid is bind on the datable, and it's working well.
  But my aim is to switch the background color of the cell depending of the Quality value.</p>
  
  <p>I intend tu use datatemplate but don't know how it's working at all...</p>
  
  <pre><code>&lt;dg:DataGrid  Name="DataGridResult" IsReadOnly="True" AutoGenerateColumns="False"
       BorderThickness="1" BorderBrush="{DynamicResource clBLACK}"
       CanUserReorderColumns="False"
       ItemsSource="{Binding Path=Result}"&gt;
            &lt;dg:DataGrid.Resources&gt;
               &lt;Style TargetType="{x:Type dg:DataGridCell}"&gt;
                  &lt;Style.Setters&gt;
                     &lt;Setter Property="Background" Value="{Binding [1].Quality}"/&gt;
                  &lt;/Style.Setters&gt;
               &lt;/Style&gt;
            &lt;/dg:DataGrid.Resources&gt;           
            &lt;dg:DataGrid.ItemTemplate&gt;
               &lt;DataTemplate&gt;
                  &lt;dg:DataGridCell&gt;
                     &lt;/dg:DataGridCell&gt;
               &lt;/DataTemplate&gt;
             &lt;/dg:DataGrid.ItemTemplate&gt;
  &lt;/dg:DataGrid&gt;
  </code></pre>
  
  <p>Actually, if the Value of the background's setter is set to "Blue", all cells are blued, so it's fine, but I can't find a way to bind it to my property.
  the [1] seems to return the column 1 of the row... </p>
  
  <p>How to set to the cell dynamically ?
  'Cause i've got a dynamic number of columns but there all of the CValue Type.</p>