C# – How to show or hide properties dynamically in the PropertyGrid

cnetpropertygridwinforms

I am using a PropertyGrid for configuring objects. I need to be able to hide or show some properties depending on the values of other properties. How this can be achieved? I know about Browsable attribute, but it only works at a compile time.

Best Answer

Take a look into the ICustomTypeDescriptor Interface.

Further informations on how to use it can be found in this article: