title: WPF binding to individual 'rows' (not columns) of a datagrid possible?
body: <p>I have a datagrid. A column of the datagrid is a simple <code>&lt;DataGridTemplateColumn&gt;</code> with its CellTemplate containing a <code>&lt;DataTemplate&gt;</code> which contains a <code>&lt;ComboBox&gt;</code> such as</p>
  
  <pre><code>&lt;my:DataGrid Name="dataGridMain" AutoGenerateColumns="False"&gt;
     &lt;my:DataGrid.Columns&gt;
         &lt;my:DataGridTemplateColumn Header="Food" &gt;
             &lt;my:DataGridTemplateColumn.CellTemplate &gt;
                 &lt;DataTemplate&gt;
                    &lt;ComboBox Name="comboDataTemplate" 
                              Text="{Binding Path=Food, 
                                             Mode=TwoWay, 
                                             UpdateSourceTrigger=PropertyChanged}"
                              ItemsSource="{Binding Source={StaticResource resFoodLookups}}"
                              DisplayMemberPath="FoodName" 
                              SelectedValuePath="FoodID" IsEditable="True" /&gt;
                  &lt;/DataTemplate&gt;
             &lt;/my:DataGridTemplateColumn.CellTemplate&gt;
         &lt;/my:DataGridTemplateColumn&gt;
      &lt;/my:DataGrid.Columns&gt;
  &lt;/my:DataGrid&gt;
  </code></pre>
  
  <p>All is working fine. Each combobox is bound to a static list due to the <code>ItemsSource="{Binding Source={StaticResource resFoodLookups}}"</code> statement.</p>
  
  <hr>
  
  <p>But my requirement is that this list will change from row-to-row.</p>
  
  <p>That is: each time a user types a new entry in the combobox list on one row, I want to have it available in the selection on the next row.</p>
  
  <p>Basically, I want to create a new list for the user each time the user inserts a new word in the combobox on any of the rows. (The combobox is editable).</p>
  
  <p>Now, I can wire up the "ItemsSource=..." at run-time, but I'm only able to do this once thus the <code>&lt;DataTemplate&gt;</code> propagates the 'same' list to 'all' the comboboxes on 'all' the rows.</p>
  
  <p>My thoughts are that I need to change the ItemsSource=... property on an object-by-object basis on each combobox that is created in memory after the DataTemplate has created them - but I have no idea how to do this.</p>