5

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.

Peter17
  • 3,052
  • 9
  • 47
  • 77
  • I have found the following example: http://www.codeproject.com/KB/tabs/DynPropGrid.aspx You can include conditions what to show and what to hide in you code. – VonDequen Apr 29 '11 at 12:21

2 Answers2

5

Take a look into the ICustomTypeDescriptor Interface.

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

Oliver
  • 43,366
  • 8
  • 94
  • 151
-2

Check this link Changing Browsable Property Attribute dynamically.A sample method is given. Using Reflection access the Property and set its browsable property to true or false.

Rajeev
  • 1
  • 1