B
batvanio
Hi,
I was trying to use a PropertyGrid control to display the properties of
one particular class. Now, one of the class properties is of enum type
( its value is limited to a set of values). I can apply the DisplayName
attribute to the property itself (which will give me a human friendly
name of the property itself).
When you have an enum property, it automatically displays as a combobox
in the Property Grid, which is very nice. However, when I open that
particular element in the PropertyGrid, it would display the
identifiers of all the enumerated values, which is ugly (I guess no one
likes to see in a GUI the guts of the softwrae, like identifiers like
myThirdOfFivePossibleValues).
I would like to be able to apply the DisplayName attribute to each
possible value from the enum type, so when users click on that
particular property, they will see a nice list of human friendly
descriptions instead of identifiers. However, it says it cannot be
applied to enums, only to properties...
Any idea for a workaround?
Thanks,
Ivan
I was trying to use a PropertyGrid control to display the properties of
one particular class. Now, one of the class properties is of enum type
( its value is limited to a set of values). I can apply the DisplayName
attribute to the property itself (which will give me a human friendly
name of the property itself).
When you have an enum property, it automatically displays as a combobox
in the Property Grid, which is very nice. However, when I open that
particular element in the PropertyGrid, it would display the
identifiers of all the enumerated values, which is ugly (I guess no one
likes to see in a GUI the guts of the softwrae, like identifiers like
myThirdOfFivePossibleValues).
I would like to be able to apply the DisplayName attribute to each
possible value from the enum type, so when users click on that
particular property, they will see a nice list of human friendly
descriptions instead of identifiers. However, it says it cannot be
applied to enums, only to properties...
Any idea for a workaround?
Thanks,
Ivan