ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor

Tweaks: TypeDescriptionProvider still replaces metadata (not extends) can also be added be TypeDescriptor.AddProvider can be applied per-type as well as per-instance, making it possible to apply to lists without having to implement ITypedList TypeConverter for PropertyGrid, this is also the mechanism used to obtain metadata; note that ExpandableObjectConverter simply delegates to TypeDescriptor.GetProperties, but this is … Read more

How to create custom PropertyGrid editor item which opens a form?

You need to implement a modal UITypeEditor, using the IWindowsFormsEditorService service to display it: using System.ComponentModel; using System.Drawing.Design; using System.Windows.Forms; using System.Windows.Forms.Design; using System; class MyType { private Foo foo = new Foo(); public Foo Foo { get { return foo; } } } [Editor(typeof(FooEditor), typeof(UITypeEditor))] [TypeConverter(typeof(ExpandableObjectConverter))] class Foo { private string bar; public string … Read more