Developer forum

Forum » CMS - Standard features » Can I sort the OptionItem in a codefirst item DropDownList?

Can I sort the OptionItem in a codefirst item DropDownList?

Peter Leleulya
Peter Leleulya
Reply

When i have this dropdown list in my code first item:

[Group(
            ItemConstants.Group_HashtagSelectionGroup, 
            LayoutGroupMetadata.GroupCollapsibleState.Expanded, 
            nameof(HashtagFilterOption), 
            GroupVisibilityRule.VisibilityCondition.Equals, 
            "Select")] 
        [DoNotIncludeInSearch]
        [DropdownList(ItemConstants.Field_HashtagFilter)]
        [OptionItem(
            nameof(Hashtag.Hashtag), 
            nameof(Hashtag.Hashtag.Title), 
            nameof(Id), 
            IncludeChilds = true,
            SourceType = FieldOptionItemSourceType.Page, 
            SourceId = ItemConstants.Page_Id_Hashtag, 
            IncludeParagraphs = false)]
        public string HashTagFilter { getset; }

 

It results in:

 

Is there a way to sort this list alphabeticaly?
It is quite a long list and kinda useless when usorted ...

 

 

 

 


Replies

 
Nicolai Pedersen
Reply

Currently that is not supported. Neither the attribute or the underlying logic retrieving the values...

Sorry about the inconvenience!

Nicolai

 

You must be logged in to post in the forum