menu

Document Processing

PdfLoadedRadioButtonListField Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfLoadedRadioButtonListField Class

    Represents radio button field of an existing PDF document.

    Inheritance
    System.Object
    PdfField
    PdfLoadedField
    PdfLoadedStyledField
    PdfLoadedStateField
    PdfLoadedRadioButtonListField
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfField.DisableAutoFormat
    PdfField.Flatten
    PdfField.GetValue(String)
    PdfField.Initialize()
    PdfField.Layer
    PdfField.PdfTag
    PdfField.PropertyChanged
    PdfField.SetValue(String, String)
    PdfField.TabIndex
    PdfLoadedField.Export
    PdfLoadedField.Form
    PdfLoadedField.MappingName
    PdfLoadedField.Name
    PdfLoadedField.ObjectID
    PdfLoadedField.Page
    PdfLoadedField.ReadOnly
    PdfLoadedField.Required
    PdfLoadedField.SetName(String)
    PdfLoadedField.ToolTip
    PdfLoadedStateField.Remove(PdfLoadedStateItem)
    PdfLoadedStateField.SetCheckedStatus(Boolean)
    PdfLoadedStyledField.BorderColor
    PdfLoadedStyledField.BorderStyle
    PdfLoadedStyledField.BorderWidth
    PdfLoadedStyledField.Bounds
    PdfLoadedStyledField.DefaultIndex
    PdfLoadedStyledField.DefineDefaultAppearance()
    PdfLoadedStyledField.Font
    PdfLoadedStyledField.GetGraphicsProperties(PdfLoadedStyledField.GraphicsProperties, PdfLoadedFieldItem)
    PdfLoadedStyledField.GotFocus
    PdfLoadedStyledField.Location
    PdfLoadedStyledField.LostFocus
    PdfLoadedStyledField.MouseDown
    PdfLoadedStyledField.MouseEnter
    PdfLoadedStyledField.MouseLeave
    PdfLoadedStyledField.MouseUp
    PdfLoadedStyledField.RotationAngle
    PdfLoadedStyledField.Size
    PdfLoadedStyledField.StyleToString(PdfCheckBoxStyle)
    PdfLoadedStyledField.Visibility
    PdfLoadedStyledField.Visible
    Namespace: Syncfusion.Pdf.Parsing
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfLoadedRadioButtonListField : PdfLoadedStateField, IPdfWrapper, INotifyPropertyChanged
    Examples
    //Load an existing document
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Read the 'Gender' radio button field         
    PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
    // Flatten the radio button field
    radiobuttonField.Flatten = true;
    doc.Save("LoadedForm.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    ' Read the 'Gender' radio button field         
    Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
    ' Flatten the radio button field
    radiobuttonField.Flatten = True
    doc.Save("LoadedForm.pdf")
    doc.Close(True)

    Properties

    Items

    Gets the collection of radio button items.[Read-Only]

    Declaration
    public PdfLoadedRadioButtonItemCollection Items { get; }
    Property Value
    Type Description
    PdfLoadedRadioButtonItemCollection

    A PdfLoadedRadioButtonItemCollection that represents the items within the list.

    Examples
    //Load an existing document
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Getting the 'Gender' radio button field          
    PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
    // Radio button field collection
    PdfLoadedRadioButtonItemCollection radiobuttonFieldCollection =  radiobuttonField.Items;
    // Radio button field item
    PdfLoadedRadioButtonItem radiobuttonItem = radiobuttonFieldCollection[0];
    // Selected the item 
    radiobuttonItem.Checked = true;         
    doc.Save("LoadedForm.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    ' Getting the  'Gender' radio button field         
    Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
    ' Radio button field collection
    Dim radiobuttonFieldCollection As PdfLoadedRadioButtonItemCollection = radiobuttonField.Items
    ' Radio button field item
    Dim radiobuttonItem As PdfLoadedRadioButtonItem = radiobuttonFieldCollection(0)
    ' Selected the item 
    radiobuttonItem.Checked = True
    doc.Save("LoadedForm.pdf")
    doc.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedRadioButtonListField
    PdfLoadedRadioButtonItem

    SelectedIndex

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

    Declaration
    public int SelectedIndex { get; set; }
    Property Value
    Type Description
    System.Int32

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

    Examples
    //Load an existing document
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Read the 'Gender' radio button field   
    PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
    // Set the selected index as 1
    radiobuttonField.SelectedIndex = 1;
    // Save the document to a disk
    doc.Save("Form.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    ' Read the 'Gender' radio button field   
    Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
    ' Set the selected index as 1
    radiobuttonField.SelectedIndex = 1
    ' Save the document to a disk
    doc.Save("Form.pdf")
    doc.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedRadioButtonListField

    SelectedItem

    Gets the selected item.[Read-Only]

    Declaration
    public PdfLoadedRadioButtonItem SelectedItem { get; }
    Property Value
    Type Description
    PdfLoadedRadioButtonItem

    Return the item as PdfLoadedRadioButtonItem class

    Examples
    //Load an existing document
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Read the 'Gender' radio button field   
    PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
    // Read the selected item of the radio button
    PdfLoadedRadioButtonItem radiobuttonItem = radiobuttonField.SelectedItem;
    // Uncheck the selected item
    radiobuttonItem.Checked = false;
    // Save the document to a disk
    doc.Save("Form.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    ' Read the 'Gender' radio button field   
    Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
    ' Read the selected item of the radio button
    Dim radiobuttonItem As PdfLoadedRadioButtonItem = radiobuttonField.SelectedItem
    ' Uncheck the selected item
    radiobuttonItem.Checked = False
    ' Save the document to a disk
    doc.Save("Form.pdf")
    doc.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedRadioButtonListField

    SelectedValue

    Gets or sets the value of the first selected item in the list.

    Declaration
    public string SelectedValue { get; set; }
    Property Value
    Type Description
    System.String

    A string value specifying the value of the first selected item, null (Nothing in VB.NET) if there is no selected item.

    Examples
    //Load an existing document
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Read the 'Gender' radio button field   
    PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
    // Set the selected index as 1
    radiobuttonField.SelectedValue = "Female";
    // Save the document to a disk
    doc.Save("Form.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    ' Read the 'Gender' radio button field   
    Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
    ' Set the selected index as 1
    radiobuttonField.SelectedValue = "Female"
    ' Save the document to a disk
    doc.Save("Form.pdf")
    doc.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedRadioButtonListField

    Value

    Gets or sets the value of specified item.

    Declaration
    public string Value { get; set; }
    Property Value
    Type Description
    System.String

    A string value representing the value of the item.

    Examples
    //Load an existing document
    PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
    // Read the 'Gender' radio button field   
    PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
    // Set the radio box value as Male
    radiobuttonField.Value = "Male";
    // Save the document to a disk
    doc.Save("Form.pdf");
    doc.Close(true);
    'Load an existing document
    Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
    ' Read the 'Gender' radio button field   
    Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
    ' Set the radio box value as Male
    radiobuttonField.Value = "Male"
    ' Save the document to a disk
    doc.Save("Form.pdf")
    doc.Close(True)
    See Also
    PdfLoadedDocument
    PdfLoadedRadioButtonListField

    Methods

    Remove(PdfLoadedRadioButtonItem)

    Remove the particular PdfLoadedRadioButtonItem from PdfLoadedRadioButtonListField.

    Declaration
    public void Remove(PdfLoadedRadioButtonItem item)
    Parameters
    Type Name Description
    PdfLoadedRadioButtonItem item
    Examples
     //Load an existing document
     PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
     //Get the loaded form.
      PdfLoadedForm loadedForm = loadedDocument.Form;
     //Get the RadioButtonList field
     PdfLoadedRadioButtonListField radioButtonField = loadedForm.Fields[0] as PdfLoadedRadioButtonListField;
     //Get the RadioButtonField item
     PdfLoadedRadioButtonItem radioButtonFieldItem = radioButtonField.Items[0] as PdfLoadedRadioButtonItem;
    //Remove the radioButtonField item
     loadedField.Remove(radioButtonFieldItem); 
    //Save the modified document.
     loadedDocument.Save("form.pdf");
    //Close the document
    loadedDocument.Close(true);

    RemoveAt(Int32)

    Remove the PdfLoadedRadioButtonListField item at the specified index.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Examples
     //Load an existing document
     PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");        
     //Get the loaded form.
      PdfLoadedForm loadedForm = loadedDocument.Form;
     //Get the radioButton Field 
     PdfLoadedRadioButtonListField radioButtonField = loadedForm.Fields[0] as PdfLoadedRadioButtonListField;       
    //Remove the radioButtonField item
     radioButtonField.RemoveAt(0);
    //Save the modified document.
     loadedDocument.Save("form.pdf");
    //Close the document
    loadedDocument.Close(true);

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    PdfLoadedStateField
    PdfLoadedDocument
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved