Spread ASP.NET 6.0 Product Documentation
Setting a Radio Button List Cell
Send Feedback
Spread ASP.NET 6.0 Product Documentation > Developer's Guide > Customizing with Cell Types > Working with Graphical Cell Types > Setting a Radio Button List Cell

Glossary Item Box

A radio button cell is a cell that displays a radio button (or option button) list. You can specify the list of options and specify whether to display the list horizontally or vertically. Unless set otherwise, the list displays horizontally in the cell. To display the list vertically, set the RepeatDirection property to Vertical. An example of each is shown in these figures.

Radio Button List (Horizontal)

Radio Button List Cell with List Displayed Vertically

To create a cell that displays a radio button list, follow the procedure described below.

Spread does not support radio buttons without labels; each radio button must have a label.

For details on the properties and methods for this cell type, refer to the RadioButtonListCellType class in the Assembly Reference.

Return to the overview of graphical cell types at Working with Graphical Cell Types.

Using Code

  1. Set the size of the cell (or column) to fit the list of options.
  2. Define the radio button list cell type by creating an instance of the RadioButtonListCellType class.
  3. Specify the list of options.
  4. Set the display properties of the cell.
  5. Assign the radio button list cell type to a specific cell.

Example

Display the vertical list of colors as radio buttons.

C# Copy Code
FpSpread1.ActiveSheetView.Columns[1].Width = 250;
string[] rbval; 
rbstr = new String[] {"Red", "Green", "Blue"}; 
rbval = new String[] {"R", "G", "B"}; 
FarPoint.Web.Spread.RadioButtonListCellType rblct = new FarPoint.Web.Spread.RadioButtonListCellType(rbstr);
rblct.Values = rbval; 
rblct.RepeatDirection = RepeatDirection.Vertical;
FpSpread1.ActiveSheetView.Cells[1, 1].CellType = rblct; 
VB Copy Code
FpSpread1.ActiveSheetView.Columns(1).Width = 250
Dim rbstr As String()
Dim rbval As String()
rbstr = New String() {"Red", "Green", "Blue"}
rbval = New String() {"R", "G", "B"}
Dim rblct As New FarPoint.Web.Spread.RadioButtonListCellType(rbstr)
rblct.Values = rbval
rblct.RepeatDirection = RepeatDirection.Vertical
FpSpread1.ActiveSheetView.Cells(1, 1).CellType = rblct

Using the Spread Designer

  1. In the work area, select the cell or cells for which you want to set the cell type.
  2. Select the Home menu.
  3. Select the SetCellType icon under the CellType section.
  4. Select the cell type and any other cell properties.
  5. Select OK to close the dialog.
  6. Click Apply and Exit to close the Spread Designer.
© 2002-2012 GrapeCity, Inc. All Rights Reserved.