Class ComboBoxField
A field that represents a control for selecting one of the provided options.
public class ComboBoxField : AbstractSelectField, IFormField, IBlockElement, IAbstractElement, IElement, IPropertyContainer, IAccessibleElement
- Inheritance
-
ComboBoxField
- Implements
- Inherited Members
Constructors
ComboBoxField(string)
Creates a new select field box.
public ComboBoxField(string id)
Parameters
id
stringthe id
Methods
AddOption(SelectFieldItem)
Add an option to the element.
public override void AddOption(SelectFieldItem option)
Parameters
option
SelectFieldItem
GetAccessibilityProperties()
public override AccessibilityProperties GetAccessibilityProperties()
Returns
GetSelectedExportValue()
Gets the export value of the selected option.
public virtual string GetSelectedExportValue()
Returns
- string
the export value of the selected option. This may be null if no value has been selected.
GetSelectedOption()
Gets the selected option.
public virtual SelectFieldItem GetSelectedOption()
Returns
- SelectFieldItem
the selected option. This may be null if no option has been selected.
MakeNewRenderer()
protected override IRenderer MakeNewRenderer()
Returns
SetSelected(int)
Selects an option by its index.
public virtual ComboBoxField SetSelected(int index)
Parameters
index
intthe index of the option to select.
Returns
- ComboBoxField
this ComboBoxField instance.
Remarks
Selects an option by its index. The index is zero-based.
SetSelected(string)
Selects an option by its export value.
public virtual ComboBoxField SetSelected(string value)
Parameters
value
stringthe export value of the option to select.
Returns
- ComboBoxField
this ComboBoxField instance.
SetSelected(SelectFieldItem)
Selects an option by its value.
public virtual ComboBoxField SetSelected(SelectFieldItem item)
Parameters
item
SelectFieldItemthe option to select.
Returns
- ComboBoxField
this ComboBoxField instance.
Remarks
Selects an option by its value. This will use the export value of the option to match it to existing options.