PdfChoiceField Class
A choice field (ISO 32000-2, 12.7.5.4): a list box or a combo box.
public sealed class PdfChoiceField : PdfFormField- Inheritance
PdfFormFieldPdfChoiceField
Properties
| Name | Description |
|---|---|
| IsComboBox | Gets a value indicating whether the field is a combo box, a drop-down list (bit 18 of PdfFormField.Flags); otherwise it is a list box. |
| IsEditable | Gets a value indicating whether a combo box also accepts a text that is not an option (bit 19 of PdfFormField.Flags). |
| IsMultiSelect | Gets a value indicating whether several options can be chosen (bit 22 of PdfFormField.Flags). |
| Options | Gets the options (/Opt, inherited). |
| SelectedValues | Gets the chosen values: the value (/V), a text or an array of texts. |
| Value | Gets or sets the chosen value, or the first of them; setting it writes the appearances of the widgets. |
IsComboBox
PdfChoiceField.csGets a value indicating whether the field is a combo box, a drop-down list (bit 18 of PdfFormField.Flags); otherwise it is a list box.
public bool IsComboBox { get; }Property value
IsEditable
PdfChoiceField.csGets a value indicating whether a combo box also accepts a text that is not an option (bit 19 of PdfFormField.Flags).
public bool IsEditable { get; }Property value
IsMultiSelect
PdfChoiceField.csGets a value indicating whether several options can be chosen (bit 22 of PdfFormField.Flags).
public bool IsMultiSelect { get; }Property value
Options
PdfChoiceField.csGets the options (/Opt, inherited).
public IReadOnlyList<PdfChoiceOption> Options { get; }Property value
SelectedValues
PdfChoiceField.csGets the chosen values: the value (/V), a text or an array of texts.
public IReadOnlyList<string> SelectedValues { get; }Property value
Value
PdfChoiceField.csGets or sets the chosen value, or the first of them; setting it writes the appearances of the widgets.
public override string? Value { get; set; }Property value
Exceptions
ArgumentException- The value is not an option, and the field is not an editable combo box.
InvalidOperationException- The field is read-only.
Methods
| Name | Description |
|---|---|
| SetSelectedValues(IEnumerable<string>) | Chooses values: the value (/V), the indexes of the options (/I) and the appearances of the widgets are written. |
SetSelectedValues(IEnumerable<string>)
PdfChoiceField.csChooses values: the value (/V), the indexes of the options (/I) and the appearances of the widgets are written.
public void SetSelectedValues(IEnumerable<string> values)Parameters
valuesIEnumerable<string>- The values: the export values of options, or a text for an editable combo box.
Exceptions
ArgumentException- A value is not an option and the field is not an editable combo box, or several values are given to a field that is not multi-select.
InvalidOperationException- The field is read-only.