Rename a property with Attributes?

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

I'm using a PropertyGrid to edit certain objects within
my application. I'd like to be able to change how the
name of certain properties are displayed:

MyObject.MyProperty displays in the PropertyGrid as "My
Property", or "whee fun property" for that matter.

Are there any class attributes that can do this, or do I
have to implement ICustomTypeDescriptor?

I know how I can implement the interface, but am looking
for an easier way out.

Thanks,
Todd.
 
Take a look at the TypeConverter class -- I'm not sure if it will do
what you want, but I think it'll be the right place to start looking.

Here's a great article on the PropertyGrid; it touches on TypeConverters
(among other things).

http://tinyurl.com/it42

There's more info on TypeConverters in the SDK docs.
 
Back
Top