I understand how Browsable attribute is supposed to work. It’s supposed to hide a property from showing up in a PropertyGrid in design time.
It also has another effect in that it will stop a Property from showing up in components such as Grids, or specifically Infragistics WinGrid. I am not sure if it has this behaviour on regular Windows Forms grids.
This works, but it doesn’t sound like Browsable is being use as intended when being used for ‘Run time’ displaying of a property on a grid component.
Any literature from Microsoft on proper use. Even though it works, I don’t want to use this attribute to hide columns on a grid bound to a business object if it’s not indeed the correct usage of the attribute, but rather something some grid vendors decided to use to determine property visibility on their grids.
There is no rule in the .NET Framework Guidelines that says that attributes should be exclusive to the kind of types for which it was designed or commonly used. Re-using them certainly helps the programmer having to memorize less class names, as long as s/he doesn’t have to jump through hoops with using/Imports directives and assembly references. Not an issue with a Windows Forms control.
Giving an attribute runtime behavior when it normally gets used to affect design-time behavior wouldn’t be my choice however. It’s Infragistics, what can I say…