Home Articles Packages

episerver epiessentials

EpiEssentials EnumProperties

Render an enum field as a dropdown in the editor.

To use, put the attribute on your property:

public enum AlignOption
{
Left,
Middle,
Right
}

[EditorDescriptor(EditorDescriptorType
= typeof(EnumEditorDescriptor<AlignOption>))]

[Display(Name = "Align", Description = "",
GroupName = SystemTabNames.Content, Order = 1)]
public virtual AlignOption Align { get; set; }