title: Bind dynamically created properties to a grid
body: <p>My class is like this,</p>
  
  <pre><code>public class Person : DynamicObject
  {
      public string Name { get; set; }
      public string Address { get; set; }
      Dictionary&lt;string, object&gt; dictionary = new Dictionary&lt;string, object&gt;();
      public int Count
      {
          get
          {
              return dictionary.Count;
          }
      }
      public override bool TryGetMember(GetMemberBinder binder, out object result)
      {
          string name = binder.Name;
          return dictionary.TryGetValue(name, out result);
      }
      public override bool TrySetMember(SetMemberBinder binder, object value)
      {
          dictionary[binder.Name] = value;
          return true;
      }
      public void AddProperty&lt;TTValue&gt;(string key, TTValue value = default(TTValue))
      {
          dictionary[key] = value;
      }
      public void AddProperty(string typeName, string key, object value = null)
      {
          Type type = Type.GetType(typeName);
          dictionary[key] = Convert.ChangeType(value, type);
      }
  }
  </code></pre>
  
  <p>Then I'm creating objects from this class and add it to a list</p>
  
  <pre><code>dynamic p = new Person();
  p.Name = "john";
  p.Address = "address1";
  p.AddProperty&lt;DateTime&gt;("BirthDate", DateTime.Now);
  p.AddProperty("System.String", "Weigth", "70 kg");
  
  List&lt;Person&gt; lstPerson=new List&lt;Person&gt;();
  
  lstPerson.Add(p);
  </code></pre>
  
  <p>After add few person objects like this I bind this to a datagrid view using a binding source. But after bound to the grid view my dynamically created properties are not shown in the grid.</p>