title: How to bind XML to a DataGrid in Silverlight
body: <p>I have an app that receives XML from a server. I want to bind the data to a data grid and it would be grate if the grid auto generated the columns. So far I have tried to this much in my code.</p>
  
  <p>XAML page:</p>
  
  <pre><code>&lt;data:DataGrid x:Name="Status" ItemsSource="{Binding}" AutoGenerateColumns="True"&gt;
  &lt;/data:DataGrid&gt;
  </code></pre>
  
  <p>Code behind for the page:</p>
  
  <pre><code>void Status_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
  {
      XElement recordSet = XElement.Load(e.Result);
      CamerasStatusTabDataGrid.ItemsSource = recordSet.Elements("Status");
  }
  </code></pre>
  
  <p>XML from the server:</p>
  
  <pre><code>&lt;StatusReport&gt;
      &lt;Status Description="Spilled Coffe on Server" Date="2/5/2009" /&gt;
      &lt;Status Description="Mice in Copier" Date="4/3/2008" /&gt;
      &lt;Status Description="Helped User Find Any Key" Date="6/2/2008" /&gt;
  &lt;/StatusReport&gt;
  </code></pre>
  
  <p>What I am looking to do is to have the status be a row in the grid with "Description" and "Date" being columns.</p>