Rename a property with Attributes?

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.
 
J

Joe White

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.
 

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