title: Show popup during editing of WPF DataGrid cell
body: <p>Along the same lines as <a href="https://stackoverflow.com/questions/6198628">How do I place a Popup in my DataGridTemplateColumn.CellEditingTemplate correctly?</a>, I am trying to have a PopUp appear below a cell in a DataGrid when the cell is being edited, and disappear when the cell is no longer being edited.  The final thing is that the PopUp contents are dynamic according to the column, and the columns are created dynamically via binding.</p>
  
  <p>I started out with the following XAML, but I get a XamlParseException "Add value to collection of type 'System.Windows.Controls.ItemCollection' threw an exception".</p>
  
  <pre><code>&lt;DataGrid ItemsSource="{Binding Path=Options}"&gt;
      &lt;DataGridTemplateColumn&gt;
          &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;Grid&gt;
                      &lt;Popup Placement="Bottom" IsOpen="True" Width="200" Height="100"&gt;
                          &lt;TextBlock&gt;Somethingn here&lt;/TextBlock&gt;
                      &lt;/Popup&gt;
                  &lt;/Grid&gt;
              &lt;/DataTemplate&gt;
          &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
      &lt;/DataGridTemplateColumn&gt;
  &lt;/DataGrid&gt;
  </code></pre>