propertyGrid impossibility

R

Ron M. Newman

Hi,

Combo boxes property values in property grids are done using the use of
enums.

private enum Fruit

{

Apple, Banana, Orange, Peach, Pear

}

What happens if I want to have class names in there? I can't use
"System.Object". the dot doesn't compile. is there a way around that?

thanks,

Ron
 
J

Jon Shemitz

Ron M. Newman said:
Combo boxes property values in property grids are done using the use of
enums.

private enum Fruit

{

Apple, Banana, Orange, Peach, Pear

}

What happens if I want to have class names in there? I can't use
"System.Object". the dot doesn't compile. is there a way around that?

Of course.

Define a TypeConverter. Override the GetStandardValuesSupported,
GetStandardValues, CanConvertFrom, ConvertFrom, and ConvertTo methods.
Apply to your enum as an TypeConverterAttribute.
 

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