Developer forum

Forum » Development » Code first item drop down list

Code first item drop down list

Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

I have tried to use the examples available, but cant get it working.

I'm trying to create a drop down list with static options like this.
https://www.screencast.com/t/2jXvPrntL

But it ends up like this.
https://www.screencast.com/t/dnhSTY8W


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

I think you mix 2 list types.

using the fields attribute

[Group("MappingFields", LayoutGroupMetadata.GroupCollapsibleState.Collapsed)]
[Field("Category", typeof(DropDownListEditor<string>))]
[OptionItem("ExampleCategory", "Name", "Id", SourceType = FieldOptionItemSourceType.CurrentArea)]

Using the DropdownList attribute:

[Group("ListFields")]
[DropdownList]
[Option("News"), Option("Featured"), Option("Add")]
[DefaultValue("News")]
Votes for this answer: 1

 

You must be logged in to post in the forum