.netwinformspropertygriddesign-timeuitypeeditor

How WinForms PropertyGrid finds custom type converters in external libraries?


We have a custom control. Some properties of this control use custom type converters and UI type editors, and they are implemented in a separate design-time DLL. These type converters are defined using the string syntax of the TypeConverter and Editor attributes, for example:

[TypeConverter("<full class name>, <library name>, Version=<version>")]
public CustomType Property1
{
    // property implementation
}

When we display the properties of our custom control in the standard PropertyGrid control from the WinForms package in a compiled app, the corresponding type converters and UI type editors from our design-time DLL are found only when we place this DLL in the folder containing the application exe. We do not want to duplicate the design-time DLL in this folder for some reasons. Is there any other way to tell the PropertyGrid control where it can find the design-time DLL referenced this way?


Solution

  • You can use either of the following options:

    Note: None of the above options need adding a reference to the assembly which contains the type converter.