PropertyGrid: show/hide properties at runtime?

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?
 
S

Shawn Burke [MS]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top