title: How i set a DataTable to be the ItemsSource of a DataGridComboBoxColum?
body: <p>I have a DataTable with two Columns that i will bind to all the ComboBoxes of a DataGridComboBoxColumn where one of the Columns will be the Text of the Items, and other will be the Values of the Items.</p>
  
  <p>I know that the property called 'DisplayMemberPath' is where i specify the Name of the Column to be the Text of the Items, and to the values it have to be specified in the 'SelectedValuePath' property.</p>
  
  <p>But one more time it's a problem to Bind whatever to a DataGridComboBoxColumn because it can't access the DataContext of the DataGrid.</p>
  
  <p>So how i set a DataTable to be the ItemsSource of a DataGridComboBoxColum?</p>
  
  <p>Example where what i want works in Code Behind:</p>
  
  <pre><code>TestClass test = new TestClass();
  
  dataGrid.Columns.Add(new DataGridComboBoxColumn()
  {
      Header = "City",
      DisplayMemberPath = "Cities",
      SelectedValuePath = "ID",
      ItemsSource = test.Dt.DefaultView,
  });
  </code></pre>
  
  <p>Here is my XAML Code:</p>
  
  <pre><code>&lt;Window x:Class="WpfApp3.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:WpfApp3
      Title="MainWindow" Height="350" Width="600"&gt;
  
      &lt;Grid Name="grid1"&gt;
          &lt;DataGrid Name="dataGrid" AutoGenerateColumns="False" MinColumnWidth="100"&gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridComboBoxColumn Header="City" DisplayMemberPath="Cities" SelectedValuePath="ID" ItemsSource="{Binding local:TestClass.Dt}"/&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Here is my Code Behind code:</p>
  
  <pre><code>public class TestClass
  {
      public TestClass()
      {
          (...)
          //Here i am loading my DataTable
      }
  
      private static DataTable dt;
  
      public static DataTable Dt
      {
          get { return dt; }
      }
  }
  </code></pre>