SelectListAttribute Class

SelectListAttribute Class

Renders a select list editor for this property. Displays a multiple select list in case of a collection type, or a dropdown list otherwise. The option keys will be set as property value. The member type may be string or any other simple type, provided the option key can be converted from string. Options can be set during compile-time by passing them in the constructor, or by registering an ISelectOptionsProvider implementation in the DI container to populate options during runtime.

[AttributeUsage(AttributeTargets.Property)]
public class SelectListAttribute: Attribute, IPropertyModelAttribute

Inheritance  Attribute SelectListAttribute

Implements  IPropertyModelAttribute

Constructors

Name Description
SelectListAttribute(string[]) Configures a select list editor with constant compile-time select options.

Properties

Name Description
Placeholder Placeholder that is displayed when no value is selected. Only applies to Dropdown list style.

Methods

Name Description
Apply(PropertyDefinition)