title: How to bind DataTable to Datagrid
body: <p>I have a problem binding a <code>DataTable</code> to a <code>DataGrid</code>. I have already searched for solutions but just can't get rid of the error. <em>The binding works fine when using WindowsForms, so the <code>DataTable</code> is correct.</em> I just can't bind it to a WPF-DataGrid.</p>
  
  <blockquote>
    <p><strong>Error message:</strong> AmbiguousMatchException was unhandled<br>
    Source: mscorlib</p>
  </blockquote>
  
  <p>I have already set up new project to get rid of any bad links, etc.</p>
  
  <p><strong>XAML-Code:</strong></p>
  
  <pre><code>&lt;DataGrid x:Name="grid1" Margin="10" ItemsSource="{Binding}" 
            AutoGenerateColumns="True"&gt;&lt;/DataGrid&gt;
  </code></pre>
  
  <p><strong>I have already tried following C#-Code behind:</strong></p>
  
  <pre><code>grid1.ItemsSource = dt.DefaultView;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>grid1.DataContext = dt.DefaultView;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>grid1.DataContext = dtex;
  </code></pre>
  
  <p>Any help is appreciated.</p>