Skip to main content
All docs
V24.1
Row

FormControlCollection.AddButton(CellRange) Method

Creates a button form control at the specified cell range.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

ButtonFormControl AddButton(
    CellRange targetRange
)

Parameters

Name Type Description
targetRange CellRange

A cell range where the form control should be located.

Returns

Type Description
ButtonFormControl

A button form control.

Remarks

Example

The code sample below creates a button form control:

Workbook workbook = new Workbook();
workbook.LoadDocument("Document.xlsx");

var cellRange = workbook.Worksheets[0].Range["B2:C4"];
var buttonFormControl = formControls.AddButton(cellRange);
buttonFormControl.PlainText = "Click Here";
buttonFormControl.PrintObject = false;

The following code snippets (auto-collected from DevExpress Examples) contain references to the AddButton(CellRange) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also