PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms PropertyDescriptor.SetValue on ReadOnly properties

Reply

PropertyDescriptor.SetValue on ReadOnly properties

 
Thread Tools Rate Thread
Old 12-12-2005, 09:05 PM   #1
=?Utf-8?B?VGhvbWFzIENocmlzdGlhbnNlbg==?=
Guest
 
Posts: n/a
Default PropertyDescriptor.SetValue on ReadOnly properties


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
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off