Thank you for the response. I am adding the editor in the GetProperties method of the custom type descriptor. The problem I am seeing that the property that I am adding is not getting assocated with the Editor Attribute.
Here is a code snippet that shows what I'm doing:
public override PropertyDescriptorCollection GetProperties(Attribute[]attributes)
{
var myProps = GetMyDescriptors();
List<PropertyDescriptor> newMyProps = new List<PropertyDescriptor>();
foreach (var j in myProps)
{
if (j.Name == "Unit")
{
PropertyDescriptor desc = TypeDescriptor.CreateProperty(j.ComponentType, j, new Attribute[] { new EditorAttribute(typeof(DialogTextBoxPropertyEditor), typeof(PropertyEditor)) });
newMetadataProps.Add(desc);
}
else
{
newMyProps.Add(j);
}
}
// Merge the default properties with any dynamic properties
var props = base.GetProperties().Cast<PropertyDescriptor>().Union(newMyProps);
I'm not sure this even possible. The problem I am tryin got solve is I am creating some dynamic properties that are added to a property grid. Some of those properties can be edited with a text property editor. Since they are dynamic, I can't associate the editor to the property via the Editor[] syntax.