Episerver 11 – Creating dropdown

Sometimes we need add a custom Dropdown, , that can mean a lot of things

In the example below I had to add an dropdown where the user can select the “kind” Icon that will be used on the block

So first thing to add on your project is the property itself  (The code below was tested in EPISERVER 11)

[BackingType(typeof(PropertyNumber))]
[EditorDescriptor(EditorDescriptorType = typeof(EnumEditorDescriptor<IconType>))]
pblic virtual IconType ServiceAreaIcon { get; set; }

The second piece, is the Dropdown values

public enum IconType
{
Eletrocardio = 0,
Phone = 1,
FirstAidKit = 2
}

Service Area

and the part 3 it will be the base , where the magic happens

Now, copy the whole class below and add to your project