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;
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?
We don't have control similar to windows property grid.
I tried your sample its working. Can we change the look and feel of the property grid. I want to change the scroll bar look and feel.
Is there any control similar to windows property grid in infragistics.
Thanks
akshay
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.