Class PdfLoadedRadioButtonListField
Represents radio button field of an existing PDF document.
Inheritance
System.Object
PdfLoadedRadioButtonListField
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
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.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
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
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
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
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
Methods
Remove(PdfLoadedRadioButtonItem)
Declaration
public void Remove(PdfLoadedRadioButtonItem item)
Parameters
Type | Name | Description |
---|---|---|
PdfLoadedRadioButtonItem | item |
RemoveAt(Int32)
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Implements
System.ComponentModel.INotifyPropertyChanged