Kentico 12 DropDownComponent

Mikhail Dervel asked on December 18, 2018 14:21

Hi all,

How to define values for DropDownComponent ? I mean case when I use implementation of IWidgetProperties and try to set DropDownComponent as identifier in attribute EditingComponent. I've tried to use EditingComponentProperty("Items", somevalue) but it's not possible because second argument is object and there is restriction of C# language.

    public class SomeWidgetProperties : IWidgetProperties
    {
        [EditingComponent(DropDownComponent.IDENTIFIER, Order = 0, Label = "Some")]
        [EditingComponentProperty("Items",new SelectListItem())]
        public string SomeValue { get; set; }
    }

Correct Answer

Mikhail Dervel answered on December 19, 2018 05:49

Thanks Drazen! One little correction : you should use property DataSource instead Items. That code below works fine

[EditingComponentProperty("DataSource", "light;Light\r\ndark;Dark")]
0 votesVote for this answer Unmark Correct answer

Recent Answers


Dražen Janjiček answered on December 18, 2018 16:22

Please try something like this:

[EditingComponentProperty("Items", "light;Light\r\ndark;Dark")]

0 votesVote for this answer Mark as a Correct answer

Dražen Janjiček answered on December 19, 2018 08:48

Yeah I didn't pay attention, just focused on the items themselves :-)

0 votesVote for this answer Mark as a Correct answer

Troy Fulton answered on January 10, 2019 00:01

Are we able to have a path selector for an input component? What would the syntax for it be?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.