Table of Contents

Class ComboBoxField

Namespace
iText.Forms.Form.Element
Assembly
itext.forms.dll

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 string

the id

Methods

AddOption(SelectFieldItem)

Add an option to the element.

public override void AddOption(SelectFieldItem option)

Parameters

option SelectFieldItem

a SelectFieldItem.

GetAccessibilityProperties()

public override AccessibilityProperties GetAccessibilityProperties()

Returns

AccessibilityProperties

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

IRenderer

SetSelected(int)

Selects an option by its index.

public virtual ComboBoxField SetSelected(int index)

Parameters

index int

the 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 string

the 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 SelectFieldItem

the 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.