Hi Carl,
Is there any way to enable/disable an item in a property grid at runtime?
From my understanding, I think you want to change the ReadOnly attribute of
the item in a PropertyGrid at runtime, is it?
If so, you are going to use custom PropertyDescriptor class for those
properties, and that class should implement the
"ICustomTypeDescriptor" interface for the usage of the properties of a
PropertyGrid, you can refer to the following group links for the detail
discussion and sample code:
http://groups-beta.google.com/group/...amework.window
sforms/browse_thread/thread/1f88a0b456c11af3/439a06cf4ca0aff2?q=propertygrid
+disable+item&_done=%2Fgroups%3Fq%3Dpropertygrid+d isable+item%26hl%3Den%26lr
%3D%26sa%3DN%26tab%3Dwg%26&_doneTitle=Back+to+Sear ch&&d#439a06cf4ca0aff2
By the way, another method is enumerating the item you want to disabled,
and clone a new property item(ReadOnly: ture) with it, then remove the old
one and add the new one at run time, you can find many samples how to add
(remove) Items of a PropertyGrid at runtime in the web...
Thanks!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C
www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.