Spread Windows Forms 9.0 Product Documentation > Developer's Guide > Customizing Interaction with Cell Types > Working with Graphical Cell Types > Setting a Multiple Option Cell |
You can define multiple option buttons in a multiple option cell. This cell type offers several option buttons, either horizontally or vertically, for the user to select. Only one button can be selected at a time. The default is for none of the buttons to be selected.
To create a cell that acts like a list of multiple option buttons, use the MultiOptionCellType class. Create a multiple option cell using the following procedure.
You can customize the display and operation of the multiple options in the cell by setting the following properties.
Property | Description |
---|---|
BackgroundImage | Sets the background image for the cell. |
EditorValue | Sets which value is written to the underlying data model. |
ItemData | Sets the ItemData to use for the list. |
Items | Creates the list to use for the option buttons. |
Orientation | Sets the orientation of the option buttons. |
Picture | Customizes the option button images. |
TextAlign | Sets how text aligns in the cell. |
UseMnemonic | Sets whether access keys (hot keys or keyboard shortcuts) are used in the cell. |
For more information on the properties and methods of this cell type, refer to the MultiOptionCellType class.
For more information on the corresponding event when a user clicks on an option, refer to the FpSpread.ButtonClicked event.
The following example displays a set of options for the user to choose from.
C# |
Copy Code
|
---|---|
FarPoint.Win.Spread.CellType.MultiOptionCellType multcell = new FarPoint.Win.Spread.CellType.MultiOptionCellType(); multcell.Items = new String[] {"Carbon", "Oxygen", "Hydrogen"}; multcell.Orientation = FarPoint.Win.RadioOrientation.Horizontal; fpSpread1.ActiveSheet.Cells[0, 0].CellType = multcell; fpSpread1.ActiveSheet.Columns[0].Width = 220; |
VB |
Copy Code
|
---|---|
Dim multcell As New FarPoint.Win.Spread.CellType.MultiOptionCellType() multcell.Items = new String() {"Carbon", "Oxygen", "Hydrogen"} multcell.Orientation = FarPoint.Win.RadioOrientation.Horizontal FpSpread1.ActiveSheet.Cells(0, 0).CellType = multcell FpSpread1.ActiveSheet.Columns(0).Width = 220 |
Or right-click on the cell or cells and select Cell Type. From the list, select MultiOption. In the CellType editor, set the properties you need. Click Apply.