title: WPF Binding a List to a DataGrid
body: <p>This is my first time working with a WPF datagrid.  From what I understand I am supposed to bind the grid to a public propery in my viewmodel.  Below is the ViewModel code, as I step through the debugger GridInventory is getting set to List containing 2606 records however these records never show in the datagrid.  What am I doing wrong? </p>
  
  <pre><code>public class ShellViewModel : PropertyChangedBase, IShell
  {
      private List&lt;ComputerRecord&gt; _gridInventory;
  
      public List&lt;ComputerRecord&gt; GridInventory
      {
          get { return _gridInventory; }
          set { _gridInventory = value; }
      }
  
      public void Select()
      {
          var builder = new SqlConnectionBuilder();
          using (var db = new DataContext(builder.GetConnectionObject(_serverName, _dbName)))
          {
              var record = db.GetTable&lt;ComputerRecord&gt;().OrderBy(r =&gt; r.ComputerName);                
              GridInventory = record.ToList();
          }
      }
  }
  </code></pre>
  
  <p>My XAML is </p>
  
  <pre><code>&lt;Window x:Class="Viewer.Views.ShellView"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="InventoryViewer" Height="647" Width="1032" WindowStartupLocation="CenterScreen"&gt;
  &lt;Grid&gt;
      &lt;DataGrid x:Name="GridInventory" ItemsSource="{Binding GridInventory}"&gt;&lt;/DataGrid&gt;
      &lt;Button x:Name="Select" Content="Select" Height="40" Margin="600,530,0,0" Width="100" /&gt;
  &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>