Class PdfLoadedListItemCollection
Represents a collection of list box field items.
Implements
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.Parsing
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfLoadedListItemCollection : PdfCollection, IEnumerable
Examples
//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Create a new list item
PdfLoadedListItem listItem = new PdfLoadedListItem("Oracle", "Oracle");
// Adding item in collection
listItemCollection.Add(listItem);
doc.Save("LoadedForm.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Create a new list item
Dim listItem As PdfLoadedListItem = New PdfLoadedListItem("Oracle", "Oracle")
' Adding item in collection
listItemCollection.Add(listItem)
doc.Save("LoadedForm.pdf")
doc.Close(True)
Properties
Item[Int32]
Gets the PdfLoadedListItem at the specified index.[Read-Only]
Declaration
public PdfLoadedListItem this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
PdfLoadedListItem |
Examples
//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Getting the first item from the list item collection
PdfLoadedListItem listItem = listItemCollection[0];
listItem.Value = "C#.NET";
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Getting the first item from the list item collection
Dim listItem As PdfLoadedListItem = listItemCollection(0)
listItem.Value = "C#.NET"
doc.Save("Form.pdf")
doc.Close(True)
See Also
Methods
Add(PdfLoadedListItem)
Inserts an list item at the end of the collection.
Declaration
public int Add(PdfLoadedListItem item)
Parameters
Type | Name | Description |
---|---|---|
PdfLoadedListItem | item | a PdfLoadedListItemobject to be added to collection. |
Returns
Type | Description |
---|---|
System.Int32 | The index of item. |
Examples
//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Create a new list item
PdfLoadedListItem listItem = new PdfLoadedListItem("Oracle", "Oracle");
// Adding item in collection
listItemCollection.Add(listItem);
doc.Save("LoadedForm.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Create a new list item
Dim listItem As PdfLoadedListItem = New PdfLoadedListItem("Oracle", "Oracle")
' Adding item in collection
listItemCollection.Add(listItem)
doc.Save("LoadedForm.pdf")
doc.Close(True)
See Also
Clear()
Clears the item collection.
Declaration
public void Clear()
Examples
//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Clears the collection
listItemCollection.Clear();
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Clears the collection
listItemCollection.Clear()
doc.Save("Form.pdf")
doc.Close(True)
See Also
Insert(Int32, PdfLoadedListItem)
Inserts the list item at the specified index.
Declaration
public void Insert(int index, PdfLoadedListItem item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
PdfLoadedListItem | item | The item. |
Examples
//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Getting the first item from the list item collection
PdfLoadedListItem listItem = listItemCollection[0];
// Insert the item at first index
listItemCollection.Insert(0, listItem);
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Getting the first item from the list item collection
Dim listItem As PdfLoadedListItem = listItemCollection(0)
' Insert the item at first index
listItemCollection.Insert(0, listItem)
doc.Save("Form.pdf")
doc.Close(True)
See Also
RemoveAt(Int32)
Removes the list item at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
Remarks
Throws IndexOutOfRange exception if the index is out of bounds.
Examples
//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Remove the first item
listItemCollection.RemoveAt(0);
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Remove the first item
listItemCollection.RemoveAt(0)
doc.Save("Form.pdf")
doc.Close(True)
See Also
Implements
System.Collections.IEnumerable