Developer forum

Forum » Development » How to set dropdown source with code-first Items.

How to set dropdown source with code-first Items.

Jon List Thorsteinsson
Reply

Lets say i have the following two items:

    [Name("Blog Post")]
    [Category("Blog")]
    public class BlogPost : ItemEntry
    {
        [Text]
        public string Title { get; set; }
        [DropdownList]
        public string Author { get; set; }
    }

    [Name("Author")]
    [Category("Blog")]
    public class BlogPostAuthor: ItemEntry
    {
        [Text]
        public string Name { get; set; }
        [RichText]
        public string Bio { get; set; }
    }

How would i relate Author from BlogPost to BlogPostAuthor. I guess what i really want, is to set the "source type" on the dropdown list. Is this possible when using the code-first approach?

I tried using the attribute:

[Field("Author", typeof(Dynamicweb.Content.Items.Editors.DropDownListEditor<BlogPostAuthor>))]

But that did not work.


Replies

 
Vladimir
Reply
This post has been marked as an answer

Hi Jon List,

I'm sorry, but Items/sql sources yet are not supported with code-first approach.

We will add it asap

 

Best regards,

Vladimir

Votes for this answer: 1
 
Jon List Thorsteinsson
Reply

I see.

Thank you for you answer :)
 

 
Christian Rud Skovgaard
Reply

This feature will be released with Dynamicweb 8.5.1 late October,

Kind regards

Christian

 

You must be logged in to post in the forum