title: How to display a dynamic object in property grid?
body: <p>I have a custom object type which has to be editable in <code>PropertyGrid</code>:</p>
  
  <pre><code>public class CustomObjectType
  {
      public string Name { get; set; }        
      public List&lt;CustomProperty&gt; Properties {get; set;}
  }
  </code></pre>
  
  <p>Which has a list of custom properties:</p>
  
  <pre><code>public class CustomProperty
  {
      public string Name { get; set; }
      public string Desc { get; set; }
      public Object DefaultValue { get; set; }    
      Type type;
  
      public Type Type
      {
          get
          {
              return type;
          }
          set
          {
                  type = value;
                  DefaultValue = Activator.CreateInstance(value);
          }              
      }
  }
  </code></pre>
  
  <p>The main problem here is that the <code>PropertyGrid</code> control doesn't allow to edit, nor uses appropriate editing tools for property <code>DefaultValue</code> which is beforehand instantiated by setting value of <code>CustomProperty</code>'s field <code>Type</code>. </p>
  
  <p>Type of <code>DefaultValue</code> is only known at runtime.</p>
  
  <p>Moreover I need to supply a custom <code>TypeConverter</code> for <code>CustomProperty</code>'s property <code>Type</code> to show a drop-down list of supported types (for example, <code>Int</code>, <code>String</code>, <code>Color</code>, <code>MyOwnClass</code>).</p>
  
  <p>How would i do that?</p>