Skip to content

# PDFVisualComboBoxField

Namespace: O2S.Components.PDF4NET.View.Forms

Defines a combobox field that is displayed in a PDFDocumentView control.

    public class PDFVisualComboBoxField : PDFVisualListField

Inheritance Object → PDFVisualField → PDFVisualListField → PDFVisualComboBoxField

## Constructors

### PDFVisualComboBoxField(PDFDropDownListField)

Initializes a new PDFVisualComboBoxField object.

    public PDFVisualComboBoxField(PDFDropDownListField field)

Parameters

`field` PDFDropDownListField
The underlying field object.

## Properties

### AlternateName

Gets or sets the field alternate name.

    public string AlternateName { get; set; }

Property Value

String
An alternate field name that shall be used in place of the actual field name wherever the field shall be identified in the user interface.

### CalculateAction

Gets or sets the calculate action.

    public PDFJavaScriptAction CalculateAction { get; set; }

Property Value

PDFJavaScriptAction
A that shall be performed to recalculate the value of this field when that of another field changes.

### ComboBoxField

Gets the associated combobox field.

    public PDFDropDownListField ComboBoxField { get; }

Property Value

PDFDropDownListField
The corresponding non-visual combobox field.

### CommitOnSelectionChange

Gets or sets a value indicating whether the new value shall be committed as soon as a selection is made.

    public bool CommitOnSelectionChange { get; set; }

Property Value

Boolean
If true, the new value shall be committed as soon as a selection is made (commonly with the pointing device).

Remarks

This option enables applications to perform an action once a selection is made, without requiring the user to exit the field. If clear, the new value is not committed until the user exits the field.

### DefaultValue

Gets or sets the field default value.

    public object DefaultValue { get; set; }

Property Value

Object
The field's default value.

### Editable

Gets or sets a value indicating whether the value in combo box is editable by the user.

    public bool Editable { get; set; }

Property Value

Boolean
True if the user can edit the value selected in the combo box; otherwise false.

### EnableSpellCheck

Gets or sets a value indicating whether the field value should be spell-checked.

    public bool EnableSpellCheck { get; set; }

Property Value

Boolean
If true the text entered in the field shall be spell-checked.

Remarks

This property should be set to true only if PDFVisualComboBoxField.Editable is also true.

### Export

Gets or sets a value indicating whether the field can be exported or not.

    public bool Export { get; set; }

Property Value

Boolean
If true, the field shall be exported by a submit-form action.

### Field

Gets the underlying PDF field.

    public PDFField Field { get; internal set; }

Property Value

PDFField
The corresponding non-visual object.

### FormatAction

Gets or sets the format action.

    public PDFJavaScriptAction FormatAction { get; set; }

Property Value

PDFJavaScriptAction
A that shall be performed before the field is formatted to display its value.

### Items

Gets the items in the list.

    public PDFListItemCollection Items { get; }

Property Value

PDFListItemCollection
A list of items that define the possible values for the field.

### KeyPressAction

Gets or sets the keypress action.

    public PDFJavaScriptAction KeyPressAction { get; set; }

Property Value

PDFJavaScriptAction
A that shall be performed when the user modifies a character in a text field or combo box or modifies the selection in a scrollable list box.

### MappingName

Gets or sets the field mapping name.

    public string MappingName { get; set; }

Property Value

String
The mapping name that shall be used when exporting interactive form field data from the document.

### Name

Gets or sets the field name.

    public string Name { get; set; }

Property Value

String
The name of the field.

Exceptions

ArgumentException
Thrown when the name is not valid (null, empty, unsupported characters).

### ReadOnly

Gets or sets a value indicating whether the field is read-only.

    public bool ReadOnly { get; set; }

Property Value

Boolean
If true, the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions.

### Required

Gets or sets a value indicating whether the field is required.

    public bool Required { get; set; }

Property Value

Boolean
If true, the field shall have a value at the time it is exported by a submit-form action

### SelectedIndex

Gets or sets the lowest ordinal index of the selected items in the list.

    public int SelectedIndex { get; set; }

Property Value

Int32
The lowest ordinal index of the selected items in the list. The default is -1, which indicates that nothing is selected.

Remarks

Use this property to determine the index of the currently selected item in the list if the list control allows only one selection.

### SelectedIndexes

Gets or sets the index of the selected items in the list.

    public Int32[] SelectedIndexes { get; set; }

Property Value

Int32[]
An array of indexes of the selected items in the list. The default is null, which indicates that nothing is selected.

Remarks

Use this property to determine the indexes of the currently selected items in the list if the list control allows multiple selection.

### SelectedItem

Gets or sets the first selected item in the list.

    public PDFListItem SelectedItem { get; set; }

Property Value

PDFListItem
A that represents the selected item.

### Sort

Gets or sets a value indicating whether the field's option items shall be sorted alphabetically.

    public bool Sort { get; set; }

Property Value

Boolean
If true, the field's option items shall be sorted alphabetically.

### TextDirection

Gets or sets the text direction.

    public PDFTextDirection TextDirection { get; set; }

Property Value

PDFTextDirection
A enum member specifying the direction of the text displayed in the field.

### Type

Gets the field type.

    public PDFFieldType Type { get; }

Property Value

PDFFieldType
The field type.

### ValidateAction

Gets or sets the validate action.

    public PDFJavaScriptAction ValidateAction { get; set; }

Property Value

PDFJavaScriptAction
A that shall be performed when the field's value is changed. This action may check the new value for validity.

### Value

Gets or sets the field value.

    public object Value { get; set; }

Property Value

Object
The field value.

### VisualWidgets

Gets the collection of visual widgets for this field.

    public PDFVisualFieldWidgetCollection VisualWidgets { get; }

Property Value

PDFVisualFieldWidgetCollection
A collection of PDFVisualFieldWidget objects representing the field instances in a PDFDocumentView control.