title: Linq to list, then to DataGrid
body: <p>I have an <code>Account(accountID, accountName, transactionCount)</code> and I want, using LINQ insert all rows into <code>List</code> and display that list on <code>DataGrid</code>.</p>
  
  <p>I load rows into <code>List</code>:</p>
  
  <pre><code>List&lt;Account&gt; accounts = dataContext.Accounts.ToList();
  </code></pre>
  
  <p>Now I don't know how to insert that into <code>DataGrid</code>, I predefined <code>DataGrid</code> columns. I can imagine that I'm missing some maping.</p>
  
  <p>Also, maybe I can directly load all table rows into <code>DataGrid</code> (but with predefined columns). But I think that I will need this <code>List</code> option for joining tables.</p>
  
  <p>Here is the XAML code of DataGrid. I tried to use Gamesh tip, but grid remains blank:</p>
  
  <pre><code>&lt;DataGrid AutoGenerateColumns="False" Height="200" HorizontalAlignment="Left" Margin="164,25,0,0" Name="dataGridAccounts" VerticalAlignment="Top" Width="299"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Header="Account ID" /&gt;
          &lt;DataGridTextColumn Header="Account Name" /&gt;
          &lt;DataGridTextColumn Header="Transactions Count" /&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>