title: WPF DataGrid DataGridTemplateColumn ComboBox ItemSource
body: <p>I'm trying to create a very simple CRUD WPF application.  I have a datagrid with 2 columns, ID, and Category.  For category, I want to be able to select from a list when adding and editing.  Here's what I have so far in the xaml:</p>
  
  <pre><code>&lt;DataGrid Name="dataGridBudgetEntries" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" RowEditEnding="dataGridBudgetEntries_RowEditEnding"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Binding="{Binding ID}" Header="ID" IsReadOnly="True"&gt;&lt;/DataGridTextColumn&gt;
          &lt;DataGridTemplateColumn Header="Category"&gt;
              &lt;DataGridTemplateColumn.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBlock Text="{Binding CategoryName}" /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellTemplate&gt;
              &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;ComboBox&gt;&lt;/ComboBox&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
          &lt;/DataGridTemplateColumn&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>In the code behind, I have the following:</p>
  
  <pre><code>public MainWindow()
  {
      InitializeComponent();
  
      dataGridBudgetEntries.ItemsSource = FinancialManagementDatabase4ME.BLL.GetBudgetEntriesForDataGrid();
      List&lt;Category&gt; categories = FinancialManagementDatabase4ME.BLL.GetCategories();
  }
  </code></pre>
  
  <p>The grid is populating and the display value for category is correct.  I cannot figure out how to define the combobox in the datatemplate so that it displays the selected value along with a list of other categories.  I've seen tons of examples but cannot get any to work.</p>