I'm kind of new to working with Web Parts so excuse me if I sound ignorant :)
I have this attribute for a web part where a user selects which college they belong to in the University, based on a dropdown. Currently the way it works is that it uses the enum names of the colleges as both the value and the display text for each dropdown item. What I would like, is to have text specified for the enums to be used for the display text. For example, one of the enum values is ArtsandSciences
, but I would like it to be displayed as Arts and Sciences
, spaces included. I've done some Googling but haven't been able to find any answers. What can I do?
public enum Colleges
{
ArtsandSciences,
AppliedScienceandTechnology,
Education,
Nursing
};
private Colleges college = Colleges.ArtsandSciences;
[WebBrowsable(true),
WebDescription("The college you belong to"),
WebDisplayName("Your college"),
Category("Digital Measures"),
DefaultValue(Colleges.ArtsandSciences),
Personalizable(PersonalizationScope.User)]
public Colleges College
{
get { return college; }
set { college = value; }
}