title: How to create custom generic PropertyGrid editor item which opens a form?
body: <p>I have a custom generic form</p>
  <pre><code> public partial class MyTestForm1 : MyBrowseForm&lt;CONTACTS_BASE&gt;
  </code></pre>
  <p>where CONTACTS_BASE is an EntityFramework entity.</p>
  <p>on the parent class I would like to have a property so that when I click on it at designer time from the property grid it opens a form and on that form I would like to have a combobox populated with the fields on the CONTACTS_BASE entity.</p>
  <p>I have found this post
  <a href="https://stackoverflow.com/questions/1016239/how-to-create-custom-propertygrid-editor-item-which-opens-a-form">Marc Gravell's answer</a> helped me to open a new form when clicked on the property at design time and I have also populated the ComboBox with fields of CONTACTS_BASE. but to do this on the form load event I called to function I made to that returns the list of fields and set it to ComboBox's DataSource.</p>
  <pre><code>comboBox1.DataSource = EntityBase.BaseGetTableFieldList2&lt;CONTACTS_BASE&gt;();
  </code></pre>
  <p><a href="https://i.stack.imgur.com/r4YGx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r4YGx.png" alt="enter image description here" /></a></p>
  <p>however what I would like to accomplish is making this generic</p>
  <p>so what I would like to do is something like this to populate the ComboBox.</p>
  <pre><code>public partial class BdEditorForm &lt;TParentEntity&gt;:Form where TParentEntity:class
  {
      private void BdEditorForm_Load(object sender, EventArgs e)
      {       
       comboBox1.DataSource = EntityBase.BaseGetTableFieldList2&lt;TParentEntity&gt;();
      }
  }
  </code></pre>
  <p>is something like this possible? because When I try to do this
  I need to make make TypeEditor generic too and then when giving attributes to the  property I create</p>
  <pre><code>[Editor(typeof(BdFormTypeEditor&lt;TParentEntity&gt;), typeof(UITypeEditor))]
  [TypeConverter(typeof(ExpandableObjectConverter))]
  </code></pre>
  <p>and it says: <a href="https://i.stack.imgur.com/DOwRk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DOwRk.png" alt="enter image description here" /></a></p>
  <p>any help is appreciated thanks and sorry for my bad english</p>