How can I specify a custom UI editor for all instances of a generic type? The type is defined in another assembly, which I don't own.
This is what I tried, inspired by https://stackoverflow.com/a/849778/284795 but it didn't have any effect (the old editor remains). Here, the generic type is List<>
and the custom editor DateTimeeditor
- nonsense but this is just an example OK.
TypeDescriptor.AddAttributes(typeof(List<>),new EditorAttribute(typeof(System.ComponentModel.Design.DateTimeEditor),typeof(UITypeEditor)));
TypeDescriptor.GetEditor(new List<int>(),typeof(UITypeEditor)).Dump();
Try something in the lines of
Customer
is an arbitrary classEditorBase
is defined asCode: