Class PdfLoadedXfaListBoxField
Represents the loaded list box field of the XFA form.
Inheritance
System.Object
PdfLoadedXfaListBoxField
Inherited Members
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfLoadedXfaListBoxField : PdfLoadedXfaStyledField
Examples
//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded list box field.
PdfLoadedXfaListBoxField loadedListBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["listBoxField[0]"] as PdfLoadedXfaListBoxField;
//Set the list box selected index
loadedListBoxField.SelectedIndex = 1;
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded list box field.
Dim loadedListBoxField As PdfLoadedXfaListBoxField = TryCast(TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm).Fields("listBoxField[0]"), PdfLoadedXfaListBoxField)
'Set the list box selected index
loadedListBoxField.SelectedIndex = 1
'Save the document
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()
Constructors
PdfLoadedXfaListBoxField()
Declaration
public PdfLoadedXfaListBoxField()
Properties
Items
Gets set the list items.
Declaration
public List<string> Items { get; set; }
Property Value
Type |
---|
System.Collections.Generic.List<System.String> |
Examples
//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded list box field.
PdfLoadedXfaListBoxField loadedListBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["listBoxField[0]"] as PdfLoadedXfaListBoxField;
//Get the items of the list box field.
List<string> items = loadedComboBoxField.Items;
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded list box field.
Dim loadedListBoxField As PdfLoadedXfaListBoxField = TryCast(TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm).Fields("listBoxField[0]"), PdfLoadedXfaListBoxField)
'Get the items of the list box
Dim items As List(Of String) = loadedListBoxField.Items
'Save the document
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()
SelectedIndex
Gets or sets the default index of the list box field
Declaration
public int SelectedIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
Examples
//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded list box field.
PdfLoadedXfaListBoxField loadedListBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["listBoxField[0]"] as PdfLoadedXfaListBoxField;
//Set the list box selected index
loadedListBoxField.SelectedIndex = 1;
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded list box field.
Dim loadedListBoxField As PdfLoadedXfaListBoxField = TryCast(TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm).Fields("listBoxField[0]"), PdfLoadedXfaListBoxField)
'Set the list box selected index
loadedListBoxField.SelectedIndex = 1
'Save the document
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()
SelectedItems
Gets or sets the items to multi select
Declaration
public string[] SelectedItems { get; set; }
Property Value
Type |
---|
System.String[] |
Examples
//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded list box field.
PdfLoadedXfaListBoxField loadedListBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["listBoxField[0]"] as PdfLoadedXfaListBoxField;
//Get the selected items.
string[] selectedItems = loadedListBoxField.SelectedItems;
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded list box field.
Dim loadedListBoxField As PdfLoadedXfaListBoxField = TryCast(TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm).Fields("listBoxField[0]"), PdfLoadedXfaListBoxField)
'Get the seleted items.
Dim selectedItems As String() = loadedListBoxField.SelectedItems
'Save the document
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()
SelectedValue
Gets or sets the default value of the list box field
Declaration
public string SelectedValue { get; set; }
Property Value
Type |
---|
System.String |
Examples
//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded list box field.
PdfLoadedXfaListBoxField loadedListBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["listBoxField[0]"] as PdfLoadedXfaListBoxField;
//Set the list box selected value
loadedListBoxField.SelectedValue = "English";
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded list box field.
Dim loadedListBoxField As PdfLoadedXfaListBoxField = TryCast(TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm).Fields("listBoxField[0]"), PdfLoadedXfaListBoxField)
'Set the list box selected value
loadedListBoxField.SelectedValue = "English"
'Save the document
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()
SelectionMode
Get the if the field is multi select or not
Declaration
public PdfXfaSelectionMode SelectionMode { get; }
Property Value
Type |
---|
PdfXfaSelectionMode |
Examples
//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded list box field.
PdfLoadedXfaListBoxField loadedListBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["listBoxField[0]"] as PdfLoadedXfaListBoxField;
//Get the selection mode
PdfXfaSelectionMode mode = loadedListBoxField.SelectionMode;
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded list box field.
Dim loadedListBoxField As PdfLoadedXfaListBoxField = TryCast(TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm).Fields("listBoxField[0]"), PdfLoadedXfaListBoxField)
'Get the seletion mode.
Dim mode As PdfXfaSeletionMode = loadedListBoxField.SelectionMode
'Save the document
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()