Spread ASP.NET 17
Spread for ASP.NET 17 Product Documentation / Developer's Guide / Customizing with Cell Types / Working with Graphical Cell Types / Setting a Radio Button List Cell
In This Topic
    Setting a Radio Button List Cell
    In This Topic

    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.

    Radio Button List (Horizontal)

    Radio Button List Cell with List Displayed Vertically

    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.

    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;
    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 
    

    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.
    See Also