title: Bind List to DataGrid
body: <p>I have a problem binding a <code>List</code> to a <code>DataGrid</code> in WPF. Let me explain what I have tried.</p>
  
  <pre><code>public struct SomeInfo
  {
      public string Name;
      public string Description;
      public string ID;
  }
  
  List&lt;SomeInfo&gt; arrSomeInfo;
  </code></pre>
  
  <p>The <code>arrSomeInfo</code> contains multiple items of structure <code>SomeInfo</code>.</p>
  
  <p>The <code>DataGrid</code> Looks something like:</p>
  
  <pre><code>&lt;DataGrid Name="grdMailbag" AutoGenerateColumns="False" ItemsSource="{Binding}"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn x:Name="cID" Binding="{Binding ID}" Header="ID" /&gt;
          &lt;DataGridTextColumn x:Name="cName" Binding="{Binding Name}" Header="Name" /&gt;
          &lt;DataGridTextColumn x:Name="cDescription" Binding="{Binding Description}" Header="Description" /&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>I have tried the following without success:</p>
  
  <pre><code>this.grdMailbag.ItemsSource = arrSomeInfo; //Didn't worked
  this.grdMailbag.DataContext= arrSomeInfo;  // Didn't worked
  </code></pre>
  
  <p>What is happening is that it is adding the rows as per <code>List arrSomeInfo</code> but all the rows are blank.</p>