propertyGrid impossibility

  • Thread starter Thread starter Ron M. Newman
  • Start date Start date
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
 
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.
 
Back
Top