Developer forum

Forum » Development » ItemRelationsList not rendering from code first

ItemRelationsList not rendering from code first

Mikael Conley
Mikael Conley
Reply
Hi.
I am trying to add a ItemRelationsList field to my code first Item. 
Unfortunately ItemRelationLists are never rendered when I try to insert them via code first. 

I have tried my own custom code and some of the examples I have found. None of them render.

I am running 9.3.5 and here is my code for the ItemRelationList:
​    [ItemRelationList("Opening Hours", "OpeningHoursItem", ItemRelationListEditor.ItemListSource.ListItem)]
    public int OpeningHours { get; set; }

Any idea what is going wrong?

Replies

 
Vladimir
Reply
This post has been marked as an answer

Hi Mikael,

try please to add some fields to display in list:
   [Option("field1"), Option("field2"), Option("field3")]

Where field1, field2, field3 - name of fields from  OpeningHoursItem

Best regards, Vladimir

Votes for this answer: 1
 
Mikael Conley
Mikael Conley
Reply

That fixed it. Thanks!

 

You must be logged in to post in the forum