PropertyGrid: show/hide properties at runtime?

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

I have an instance of a class I need to display
properties for. I have created a wrapper class for this
class solely for use with a PropertyGrid. Just before
setting myPropertyGrid.SelectedObject, I create an
instance of the wrapper class.

I'd like to be able to show or hide certain properties of
this wrapper class instance at run-time based on certain
run-time conditions.

Does anyone know if and how this can be done?
 
You can do this by implementing ICustomTypeDescriptor on your wrapper class
and filtering the property list. Go to google and search for
ICustomTypeDescriptor and you'll find several threads on how to do this sort
of thing.
 
Back
Top