PropertyGrid-adding properties at runtime

  • Thread starter Thread starter FUnky
  • Start date Start date
F

FUnky

Hi all,

I would like to add properties to the propertygrid control at runtime. There
I would like to specify four things:
a. Property Name
b. Property Value
c. Property Category
d. Property Ordering

Can somebody plz guide me to do this?
Many thanks in advance.

FUnky
 
Hi,

As far as I remember, to customize the list of properties displayed by the
PropertyGrid control, one needs to implement the ICustomTypeDescriptor
interface.
 
FUnky,

If you want to add/remove properties to/from selected object in the property
grid you can do that from the TypeConverter for the object's type. You need
to implement GetPropertiesSupported and GetProperties methods.
The properties that trigger adding/removing other properties needs to be
attributed with RefreshPropertiesAttribute.
 
Back
Top