PropertyGrid and Objet (dynamic readonly)

  • Thread starter Thread starter Polo
  • Start date Start date
P

Polo

I have a instance of a class A

I show it in a propertyGrid. Sometime this object can be edited, sometime
not (all properties readonly).
How can i do it (Without the ReadOnlyAttrivute)

Thank's in advance
Polo
 
You need to put this before a property definition:

[System.ComponentModel.ReadOnly(false)]

[System.ComponentModel.ReadOnly(true)]

These are relevant if the property has both get and set definitions. A
property without a "set" definition is obviously a read-only property.

HTH, ramida
 

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

Back
Top