Edit this page
Available for: UI for ASP.NET AJAX | UI for ASP.NET MVC | UI for WPF | UI for WinForms | UI for Silverlight

FormFieldCollection

This class holds a collection of FormField instances, assigned to the AcroForm of the document. The collection exposes useful properties and methods allowing you to access, add or remove the form fields in a document.

Properties

The FormFieldCollection class exposes an indexer and a Count property allowing you to respectively get a FormField instance by its name or get the number of all form fields in the document.

Methods

You can also use several methods of the class to modify the collection of form fields in the document's AcroForm.

  • Add(): Accepts parameter of type FormField and inserts it to the collection.

  • Remove(): Accepts parameter of type FormField and removes it from the collection.

  • Contains(): Accepts a string representing the form field name. Returns true when a field with such a name is present in the collection, otherwise false.

[C#] Example 1: Using the methods of FormFieldCollection

if (document.AcroForm.FormFields.Contains(fieldName))
{
    document.AcroForm.FormFields.Remove(document.AcroForm.FormFields[fieldName]);
}

See Also