title: Bind dynamic data of Combo box in datagrid wpf
body: <pre><code>&lt;Window x:Class="Practise.DropdownGrid"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:staticData="clr-namsespace:ComboBoxDGWPF"
          Title="DropdownGrid" Height="700" Width="600" WindowState="Maximized" Background="#f0f0f0"&gt;
      &lt;Window.Resources&gt;
          &lt;staticData:StatusList x:Key="StatusList" /&gt;  // Error of Namespace
      &lt;/Window.Resources&gt;
  
      &lt;StackPanel VerticalAlignment="Center" Width="300"&gt;
  
          &lt;DataGrid AutoGenerateColumns="False" Height="366" Name="DemoGrid" ItemsSource="{Binding objLabel}" &gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn Binding="{Binding Subject}" Header="Demo Label" Width="*"&gt;
  
                  &lt;/DataGridTextColumn&gt;
                  &lt;DataGridTemplateColumn Header="Drop Down"&gt;
                      &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;ComboBox Name="ComboBoxName" ItemsSource="StatusList" SelectedItem="Status"  &gt;                                
  
                              &lt;/ComboBox&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
                  &lt;/DataGridTemplateColumn&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
      &lt;/StackPanel&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>*<em>Code behind *</em></p>
  
  <pre><code>namespace Practise
  {
      /// &lt;summary&gt;
      /// Interaction logic for DropdownGrid.xaml
      /// &lt;/summary&gt;
      public partial class DropdownGrid : Window
      {
          public DropdownGrid()
          {
              InitializeComponent();
              List&lt;MainContent&gt; objMainContent = new List&lt;MainContent&gt;{
                  new MainContent { Subject = "Maths", Status = "Open" },
                  new MainContent { Subject = "Science", Status = "Closed" },
                  new MainContent { Subject = "Computers" , Status = "high"}
              };
  
              DemoGrid.ItemsSource = objMainContent;
          }
          public class MainContent
          {
              public string Subject { get; set; }
              public string Status { get; set; }
          }
          public class StatusList : List&lt;string&gt;
          {
              public StatusList()
              {
                  this.Add("Open");
                  this.Add("Closed");
                  this.Add("High");
                  this.Add("Low");
              }
          }
      }
  }
  </code></pre>