Changing extensions in PropertyGrid

G

Guest

Hi there,

I've got a class contain some double and int values and properties..
I created a PropertyGrid and selected the class to see the values.. This is
ok..
But I would like some postfixes on my fields.. I.e. instead of just showing
"Length | 23.43", I would like it to show "Length | 23.43 m" and so on.
So it automatically appends "m" whenever i change value..
I know I can do this by setting property type to string and doing it there,
but its sooo cumbersome..
Can anyone provide any insight.
Thanks alot in advance.

Any help would
 
G

G Himangi

You will need to implement your own typeconvertor derived from TypeConvertor
and apply it to your property using the TypeConvertor attribute. In the
derived class, override CanCovertTo and ConvertTo such that it handles
strings.

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
 

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