Back to Devexpress

FormControlCollection.AddRadioButton(CellRange) Method

officefileapi-devexpress-dot-spreadsheet-dot-formcontrolcollection-dot-addradiobutton-x28-devexpress-dot-spreadsheet-dot-cellrange-x29.md

latest2.5 KB
Original Source

FormControlCollection.AddRadioButton(CellRange) Method

Creates a radio button form control at the specified cell range.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
RadioButtonFormControl AddRadioButton(
    CellRange targetRange
)
vb
Function AddRadioButton(
    targetRange As CellRange
) As RadioButtonFormControl

Parameters

NameTypeDescription
targetRangeCellRange

A cell range where the form control should be located.

|

Returns

TypeDescription
RadioButtonFormControl

The radio button form control.

|

Remarks

Example

The code sample below creates a radio button form control:

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

var cellRange = workbook.Worksheets[0].Range["B2:C4"];
var radioButtonFormControl = formControls.AddRadioButton(cellRange);
radioButtonFormControl.PlainText = "Click Here";
radioButtonFormControl.PrintObject = false;
vb
Dim workbook As New Workbook()
workbook.LoadDocument("Document.xlsx")

Dim cellRange = workbook.Worksheets(0).Range("B2:C4")
Dim radioButtonFormControl = formControls.AddRadioButton(cellRange)
radioButtonFormControl.PlainText = "Click Here"
radioButtonFormControl.PrintObject = False

Note

The FormControlCollection.AddRadioButton method call adds a new item to both FormControlCollection and ShapeCollection.

See Also

FormControlCollection Interface

FormControlCollection Members

DevExpress.Spreadsheet Namespace