title: How to bind DataTable to DataGridComboBoxColumn
body: <p>I have and DataGridComboBoxColumn in the DataGrid a WPF window. I am assigning DataContext to Window as below:</p>
  
  <pre><code>cls = new MyClass
              {
                  selValue = 2,
                  DataGrid = dtGrid,
                  ComboGrid = dtCombo
              };
  
  
              this.DataContext = cls;
  </code></pre>
  
  <p>Following is the XAML for DataGridComboBoxColumn:</p>
  
  <pre><code>    &lt;DataGridComboBoxColumn Header="Item Name" SelectedValueBinding="{Binding Path=Item_Id}" SelectedValuePath="ItemId" DisplayMemberPath="ItemName"&gt;
              &lt;DataGridComboBoxColumn.ElementStyle&gt;
                  &lt;Style TargetType="ComboBox"&gt;
  &lt;!-- modified this code as per suggestion ///--&gt;
                      &lt;Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ComboGrid }" /&gt;
                  &lt;/Style&gt;
              &lt;/DataGridComboBoxColumn.ElementStyle&gt;
              &lt;DataGridComboBoxColumn.EditingElementStyle&gt;
                  &lt;Style TargetType="ComboBox"&gt;
                      &lt;Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ComboGrid }" /&gt;
                  &lt;/Style&gt;
  
              &lt;/DataGridComboBoxColu
  </code></pre>
  
  <p>mn.EditingElementStyle>
                  </p>
  
  <p>Still Combobox in grid showing blank. No data is being listed in Combobox.  Then, I wrote following code in Windows codebehind, it start working.</p>
  
  <pre><code>((DataGridComboBoxColumn)this.testGrid.Columns[1]).ItemsSource = cls.ComboGrid.DefaultView;
  </code></pre>
  
  <p><strong>Is there anyway to handle this case in XMAL itself using MVVM?  I am reluctant to use this apporache.</strong></p>