This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/csharp/editors/pdf/formfields/pdf-combo-box-field.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. PdfComboBoxField

Represents a combo box (drop-down list) form field in a PDF document. Combo boxes display a list of options and may optionally allow custom text entry.

using Nutrient;

Inherits from: PdfFormField

The SDK creates this class through factory methods or other SDK objects.

Properties

HasSelection

public bool HasSelection { get; }

Whether the combo box has a value selected or entered.

Type: bool

ItemCount

public int ItemCount { get; }

The number of items in the combo box.

Type: int

SelectedValue

public string SelectedValue { get; set; }

The currently selected or entered value.

Type: string

Methods

AddItem

public void AddItem(string text)

Adds an item to the combo box.

Parameters

NameTypeDescription
textstringThe display text for the item.

Throws: NutrientException - Thrown when the operation fails.

public void AddItem(string text, string value)

Adds an item to the combo box with a separate export value.

Parameters

NameTypeDescription
textstringThe display text for the item.
valuestringThe export value for the item.

Throws: NutrientException - Thrown when the operation fails.

RemoveItemAt

public void RemoveItemAt(int index)

Removes an item from the combo box at the specified index.

Parameters

NameTypeDescription
indexintThe 0-based index of the item to remove.

Throws: NutrientException - Thrown when index is out of range.

Throws: NutrientException - Thrown when the operation fails.

Resource management

public void Dispose()

PdfComboBoxField implements IDisposable. Call Dispose() or use a C# using declaration to release its native handle right away. If you don’t, the handle is released when the object is garbage collected.