PropertyGrid-adding properties at runtime

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
 
D

Dmytro Lapshyn [MVP]

Hi,

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

Stoitcho Goutsev \(100\)

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.
 

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