FormControlCollection Interface
A collection of form controls.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v24.2.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
#Declaration
public interface FormControlCollection :
ISimpleCollection<FormControl>,
IEnumerable<FormControl>,
IEnumerable,
ICollection
#Related API Members
The following members return FormControlCollection objects:
#Remarks
#Access Form Controls
Use the Worksheet.FormControls
property to obtain all form controls contained in a worksheet.
To obtain an individual form control, call the FormControlCollection.GetFormControlsByName or FormControlCollection.GetFormControlById method. The FormControl.Id and FormControl.Name properties return the form control’s identifier and name.
You can also obtain a form control by its index in the collection.
#Create Form Controls
The table below lists available form controls and API used to create each type.
Form Control | Class | Method |
---|---|---|
Button | Button |
Form |
Check Box | Check |
Form |
Combo box | Combo |
Form |
Group box | Group |
Form |
List box | List |
Form |
Radio Button | Radio |
Form |
Scrollbar | Scrollbar |
Form |
Spinner | Spinner |
Form |
Note
The Form
method call adds a new item to both Form
and Shape
#Print and Export Form Controls
#Available Export Formats
You can export workbooks with form controls to the following formats:
- XLSX
- XLSM
- XLTX
- XLTM
#Disable Printing
Each form control has the PrintObject property that specifies whether to print the form control. This options also affects the form control export to PDF format.
#Remove Form Controls
Call the FormControlCollection.Remove or FormControlCollection.RemoveAt method to remove a form control.
The FormControlCollection.Clear() method call removes all form controls from a worksheet.
#Limitations
The Form Control API subset ships with the following limitations:
- The FormControl.Fill and FormControl.Outline properties are available only for CheckBoxFormControl and RadioButtonFormControl. For other form controls these properties return
null
. - The FormControl.ShapeText property returns
null
for ComboBoxFormControl, ListBoxFormControl, ScrollbarFormControl, and SpinnerFormControl.