The windows PropertyGrid doesn't have this read only functionality that you want, but there is work around to achieve this with using ICustomTypeDescriptor interface. You can try the attached project that I'm sending you. Hopefully this can help you.
Your solution is great.
I made some modifications to display the content of a collection as well.
What I can't figure out is why the Enum values don't display. Any idea?
Try changing GetValue method in the ReadOnlyPropertyDescriptor class to:
public override object GetValue(object component)
{
object obj = this.desc.GetValue(component);
Enum en = obj as Enum;
if (en != null)
return obj;
}
object readOnlyObj = new ReadOnlyObject(obj);
return readOnlyObj;