I am trying to make the property grid dynamically show / hide properties depending on the columns that are visibile/collapsed in a grid in my software.
To do so, I have implemented ICustomTypeDescriptor to expose a list of PropertyDescriptor objects, each of which has different EditorAttribute attributes applied depending on the property type.
When I show a simple data type in the property editor (i.e. bool, int, DateTime, string, etc.), the logic that "merges" two selections in the property grid displays the properties as expected. However, when I have 2 "rich" objects, they don't merge at all (the merging logic always returns null).
As an attempt, I implemented IComparable, IComparable<T>, and IEquatable<T> on my object type (the one being selected) and overrode Equals(object obj) on my implementation of the PropertyDescriptor used to display my properties (which never actually gets hit) to no avail.
What do I need to do to implement custom merging logic for the property grid for rich object types?