WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfLoadedXfaComboBoxField - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfLoadedXfaComboBoxField

    Represents the existing combo box fields of the XFA form.

    Inheritance
    System.Object
    PdfXfaField
    PdfLoadedXfaField
    PdfLoadedXfaStyledField
    PdfLoadedXfaComboBoxField
    Inherited Members
    PdfLoadedXfaStyledField.ReadOnly
    PdfLoadedXfaStyledField.Width
    PdfLoadedXfaStyledField.Height
    PdfLoadedXfaStyledField.Location
    PdfLoadedXfaStyledField.Font
    PdfLoadedXfaStyledField.ToolTip
    PdfLoadedXfaStyledField.Caption
    PdfLoadedXfaStyledField.ForeColor
    PdfLoadedXfaStyledField.Border
    PdfLoadedXfaStyledField.HorizontalAlignment
    PdfLoadedXfaStyledField.VerticalAlignment
    PdfXfaField.Name
    PdfXfaField.Margins
    PdfXfaField.Visibility
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Pdf.Xfa
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfLoadedXfaComboBoxField : 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 combo box field.
    PdfLoadedXfaComboBoxField loadedComboBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["comboBoxField[0]"] as PdfLoadedXfaComboBoxField;
    //Set the combo box selected index
    loadedComboBoxField.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 combo box field.
    Dim loadedComboBoxField As PdfLoadedXfaComboBoxField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("comboBoxField[0]"), PdfLoadedXfaComboBoxField)
    'Set the combo box selected index
    loadedComboBoxField.SelectedIndex = 1
    'Save the document 
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close()

    Constructors

    PdfLoadedXfaComboBoxField()

    Declaration
    public PdfLoadedXfaComboBoxField()

    Properties

    HiddenItems

    Get the hidden items of combo box field.

    Declaration
    public List<string> HiddenItems { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    Items

    Declaration
    public List<string> Items { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    SelectedIndex

    Gets or sets the default index of the combo box field

    Declaration
    public int SelectedIndex { get; set; }
    Property Value
    Type Description
    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 combo box field.
    PdfLoadedXfaComboBoxField loadedComboBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["comboBoxField[0]"] as PdfLoadedXfaComboBoxField;
    //Set the combo box selected index
    loadedComboBoxField.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 combo box field.
    Dim loadedComboBoxField As PdfLoadedXfaComboBoxField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("comboBoxField[0]"), PdfLoadedXfaComboBoxField)
    'Set the combo box selected index
    loadedComboBoxField.SelectedIndex = 1
    'Save the document 
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close()

    SelectedValue

    Gets or Sets the default value of the combo box field

    Declaration
    public string SelectedValue { get; set; }
    Property Value
    Type Description
    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 combo box field.
    PdfLoadedXfaComboBoxField loadedComboBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["comboBoxField[0]"] as PdfLoadedXfaComboBoxField;
    //Set the combo box selected value
    loadedComboBoxField.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 combo box field.
    Dim loadedComboBoxField As PdfLoadedXfaComboBoxField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("comboBoxField[0]"), PdfLoadedXfaComboBoxField)
    'Set the combo box selected value
    loadedComboBoxField.SelectedValue = "English"
    'Save the document 
    loadedDocument.Save("output.pdf")
    'Close the document
    loadedDocument.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved