PropertyDescriptor.SetValue on ReadOnly properties

G

Guest

I'm using PropertyDescriptor.SetValue to set the values of a number of
properties on a class. This works perfectly, when the properties doesn't have
the ReadOnly attribute set.

According to the documentation, this attribute should only prevent the
property from beeing set at design-time, but I can't get it to work at
run-time.

This is one of my properties:

[ReadOnly(true)]
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}

Any ideas why I can't set the property at run-time ?

Thanks in advance,
Thomas
 

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