Spread for ASP.NET 10 Product Documentation > Developer's Guide > Customizing with Cell Types > Working with Graphical Cell Types > Setting a Radio Button List Cell |
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. By default, the list displays horizontally in the cell. To display the list vertically, set the RepeatDirection property to Vertical. Use the Values property to add the list of options.
The following figures display the horizontal and vertical directions.
Spread does not support radio buttons without labels; each radio button must have a label. |
To create a cell that displays a radio button list, follow the procedure described below.
For details on the properties and methods for this cell type, refer to the RadioButtonListCellType class in the Assembly Reference.
Display the vertical list of colors as radio buttons.
C# |
Copy Code
|
---|---|
FpSpread1.ActiveSheetView.Columns[1].Width = 250; string[] rbval; string[] rbstr; 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 |