Setting the browsable attribute dynamically
What I want to do is set the browsable attribute (component model) of a property programmatically depending on some conditions. The reason for this is because I want to display a object in a propertygrid control sometimes with and sometimes without the property. I tried to override the browsable attribute in the propertydescriptor class, but the browsable attribute is not available there. I'll appreciate any help. Thanks in advance.
Re: Setting the browsable attribute dynamically
Instead you can associate your own ControlDesigner with your class and override the PreFilterProperties method to add or remove properties viewed in the property grid.
Re: Setting the browsable attribute dynamically
I need to do it at runtime.
Re: Setting the browsable attribute dynamically
yes...
doesn't my solution work?