title: How do I bind to a IEnumerable Dictionary in Silverlight?
body: <p><em><strong>Background information:</em></strong>
  I have the following code in a WCF service. GetDataTable returns a System.Data.DataTable based on a call to a SQL database with the <em>query</em> parameter passed.</p>
  
  <pre><code>public IEnumerable&lt;Dictionary&lt;string, object&gt;&gt; GetData(string *query*) {
      var table = GetDataTable(query);
      var columns = table.Columns.Cast&lt;DataColumn&gt;();
      var dict = table.AsEnumerable()
          .Select(r =&gt; columns.Select(c =&gt; new {
              Column = c.ColumnName,
              Value = r[c]
          })
          .ToDictionary(i =&gt; i.Column, i =&gt; i.Value != DBNull.Value ? i.Value : null));
      return dict;
  }
  </code></pre>
  
  <p>I have a Silverlight application that makes a call to GetData, passing a string, and I receieve results. However, the fields I have in my GridView are "Comparer", "Count", "Keys", and "Value".</p>
  
  <p><em>Silverlight code snippet</em></p>
  
  <pre><code>    WCFCLIENT oData = new WCFCLIENT ();
      oData.GetData+= new EventHandler&lt;GetDataCompletedEventArgs&gt;(oData_GetData);
      oData.GetData(*sqlquery*);
    }
  }
  
  void oData_GetDataCompleted(object sender, GetDataCompletedEventArgs e) {
    if (e.Error == null) {
      rdpPaging.Source = e.Result;    
      rgvDataResults.ItemsSource = rdpPaging.Source;
  }
  </code></pre>
  
  <p><em><strong>My Question is two-fold</em></strong></p>
  
  <ol>
  <li>Is the code I'm using to create the Dictionary wrong somehow?</li>
  <li>If the code is correct, how do I properly set the DataGrid's data source so it shows the columns and rows returned by the SQL call?</li>
  </ol>
  
  <p>I have tried binding to different properties of the e.Result variable, but have had similar results.</p>