title: Best way to bind DataGrid to generic list in WPF
body: <p>I am trying to bind a <code>DataGrid</code> to a generic list in WPF.</p>
  
  <p>The following code results in blank rows for each row of data in my list (i.e. if i have 5 rows, it shows 5 rows, but doesn't shows any data in the cells):</p>
  
  <pre><code>List&lt;DataRow&gt;  DataBindingSource = GuestList.Where(row =&gt;
    (row.Field&lt;long&gt;("FK_GROUP_ID") == Int64.Parse(cmbGroup.SelectedValue.ToString())) &amp;&amp;
    (row.Field&lt;long&gt;("FK_AGE_GROUP_ID") != (int)L_Age_Group.Child))
    .ToList();
  
  gvwAddultDetails.ItemsSource = DataBindingSource;
  </code></pre>
  
  <p>If I convert my list of objects to a <code>DataTable</code>, it works (shows data).  For example:</p>
  
  <pre><code>List&lt;DataRow&gt; DataBindingSource = GuestList.Where(row =&gt;
    (row.Field&lt;long&gt;("FK_GROUP_ID") == Int64.Parse(cmbGroup.SelectedValue.ToString())) &amp;&amp;
    (row.Field&lt;long&gt;("FK_AGE_GROUP_ID") != (int)L_Age_Group.Child))
    .ToList();
  
  gvwAdultDetails.ItemsSource = DataBindingSource.CopyToDataTable().DefaultView;
  </code></pre>
  
  <p><em>But if I had a <code>List&lt;DataRow&gt;</code>, how would I convert it to <code>DataTable</code>?</em></p>
  
  <p><strong>What is the best practice for binding a <code>DataGrid</code> to a `List' in WPF?</strong></p>