title: Create a custom DataGrid's ItemsSource
body: <p>I am working with DataGrids but I am struggling to binding my data since the number of columns varies depending of the info that has to be showed. </p>
  
  <p>So, what I have tried to do is to create and object which contains all the columns and rows that I need at some point and binding this object to the <code>ItemsSource</code> property. Since I have worked with DataGridViews in WindowsForms I have in mind something like this:</p>
  
  <pre><code>DataTable myTable = new DataTable();
  
  DataColumn col01 = new DataColumn("col 01");
  myTable.Columns.Add(col01);
  DataColumn col02 = new DataColumn("col 02");
  myTable.Columns.Add(col02);
  
  DataRow row = myTable.NewRow();
  row[0] = "data01";
  row[1] = "data02";
  myTable.Rows.Add(row);
  
  row = myTable.NewRow();
  row[0] = "data01";
  row[1] = "data02";
  myTable.Rows.Add(row);
  </code></pre>
  
  <p>But I haven't been able to find a way to do the same thing in WPF since I need some columns to be DataGridComboBoxColumns for example. </p>
  
  <p>Actually I have read many post about it in this site, but none of them helped to me. I am really lost.</p>
  
  <p>Could anyone help me? I just need to be able to create a table which may contain DataGridTextColumns or `DataGridComboBoxColumns, etc, In order to bind this final object to the DataGrid's ItemsSource property.</p>
  
  <p>Hope someone can help me.</p>