Class AbstractSelectField
An abstract class for fields that represents a control for selecting one or several of the provided options.
public abstract class AbstractSelectField : FormField<AbstractSelectField>, IFormField, IBlockElement, IAbstractElement, IElement, IPropertyContainer, IAccessibleElement
- Inheritance
-
AbstractSelectField
- Implements
- Derived
- Inherited Members
Constructors
AbstractSelectField(string)
Instantiates a new AbstractSelectField instance.
protected AbstractSelectField(string id)
Parameters
id
stringthe id of the field
Fields
options
protected IList<SelectFieldItem> options
Field Value
Methods
AddOption(SelectFieldItem)
Add an option to the element.
public virtual void AddOption(SelectFieldItem option)
Parameters
option
SelectFieldItem
AddOption(SelectFieldItem, bool)
Add an option to the element.
public virtual void AddOption(SelectFieldItem option, bool selected)
Parameters
option
SelectFieldItemselected
bool
AddOption(IBlockElement)
Add a container with options.
[Obsolete("starting from 8.0.1.")]
public virtual void AddOption(IBlockElement optionElement)
Parameters
optionElement
IBlockElementa container with options
Remarks
Add a container with options. This might be a container for options group.
GetItems()
Get a list of SelectFieldItem.
public virtual IList<SelectFieldItem> GetItems()
Returns
- IList<SelectFieldItem>
a list of options.
GetOption(string)
Get an option SelectFieldItem by its string value.
public virtual SelectFieldItem GetOption(string value)
Parameters
value
stringstring value to find an option by
Returns
GetOptions()
Gets a list of containers with option(s).
[Obsolete("starting from 8.0.1.")]
public virtual IList<IBlockElement> GetOptions()
Returns
- IList<IBlockElement>
a list of containers with options.
Remarks
Gets a list of containers with option(s). Every container might be a container for options group.
HasExportAndDisplayValues()
Checks if the field has options with export and display values.
public virtual bool HasExportAndDisplayValues()
Returns
HasOptions()
Checks if the element has any options.
public virtual bool HasOptions()
Returns
- bool
true if the element has options, false otherwise.
OptionsCount()
Gets the total amount of options available.
public virtual int OptionsCount()
Returns
- int
the number of options in the element.