title: Custom Editor for a Boolean Property in a PropertyGrid (C#)
body: <p>I want to assign a custom editor to a <code>boolean</code> property in a <code>PropertyGrid</code>. I'm using the standard propertygrid (from namespace <code>System.Windows.Forms</code>). It is possible to assign custom editors to properties using the <code>UITypeEditor</code> class. However, as far as I can see, it is not possible to use it for a <code>boolean</code> property.</p>
  
  <p>I've tried to solve it by overriding the property grid so I can add items manually. I can add a <code>string</code> property that has a custom editor by the following piece of code: </p>
  
  <pre><code>Properties.Item.Add("My Custom Editor", "", false, "Properties with custom UITypeEditor", "The component accept custom UITypeEditor.", true);
  Properties.Item[Properties.Item.Count - 1].CustomEditor = new MyEditor();
  </code></pre>
  
  <p>So far so good, a custom editor appears (with a button in the grid). However, when I change the type to <code>boolean</code> by setting the default value on <code>false</code> (see below), the button to open the custom editor doesn't appear. Instead, a dropdown menu with <code>true</code>/<code>false</code> appears.</p>
  
  <pre><code>Properties.Item.Add("My Custom Editor", false, false, "Properties with custom UITypeEditor", "The component accept custom UITypeEditor.", true);
  Properties.Item[Properties.Item.Count - 1].CustomEditor = new MyEditor();
  </code></pre>
  
  <p>Does anyone has a solution for this?</p>
  
  <p>Thanks in forward!</p>
  
  <p>Regards,
  Peter</p>