title: how to bind datasource to List<Dictionary<string, string>>?
body: <p>I have a class that stores a list of dictionary entries. I want bind that to a datasource for gridview from codebehind.</p>
  
  <p>Code for dictionary type of , representing ErrorMessage and failed field.</p>
  
  <pre><code>public partial class FailedFields
  {
      private Dictionary&lt;string, string&gt; Code_Error = new Dictionary&lt;string, string&gt;();
      public void AddFailedField(string field, string message)
      {
          Code_Error.Add(field, message);
      }
      public Dictionary&lt;string, string&gt; GetFailedFields()
      {
          return Code_Error;
      }
  }
  </code></pre>
  
  <p>Code for List of Dictionary entries.</p>
  
  <pre><code>public partial class ErrorFieldsList
  {
      private static List&lt;Order.FailedFields&gt; ErrorList = new List&lt;Slab.FailedFields&gt;();
      public void AddErrorField(Order.FailedFields errs)
      {
          ErrorList.Add(errs);
      }
      public List&lt;Order.FailedFields&gt; GetErrorMessages()
      {
          return ErrorList;
      }
  }
  </code></pre>
  
  <p>Running in Visual Studio debug mode, i can see the list has the error list, but i cannot get it to display in the gridview. Bellow is one of the many ways (the one that makes most sense) i tried to set the list as a datasource.</p>
  
  <pre><code>ErrorBoxGridView.DataSource = FailedRecords.GetErrorMessages(). ;
  ErrorBoxGridView.DataBind();
  </code></pre>
  
  <p>Any idea where i am going wrong ?
  Also, i don't want to specify a datasource in the aspx page because i only want to display this when the error occurs.</p>
  
  <p><em>If interested why i am doing this to store error messages, have a look at this:<a href="https://stackoverflow.com/questions/1284135/errorproviderfrom-windows-forms-for-asp-net-linq-to-sql">link 1</a></em></p>
  
  <p><strong>Solved Here</strong> <a href="https://stackoverflow.com/questions/1303866/datasource-from-cascading-listclassa-containing-listclassb">Related Question</a>
  I will document a complete project when i finish on the wiki.</p>