Click to See Complete Forum and Search --> : Setting the browsable attribute dynamically


Marais
February 28th, 2006, 07:03 AM
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.

Norfy
February 28th, 2006, 08:03 AM
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.

Marais
March 2nd, 2006, 05:21 AM
I need to do it at runtime.

Norfy
March 6th, 2006, 02:50 AM
yes...

doesn't my solution work?