Spread Windows Forms 8.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 |
Customization |
---|---|
BackgroundImage |
Set the background image for the cell. |
EditorValue |
Set which value is written to the underlying data model. |
ItemData |
Set the ItemData to use for the list. |
Items |
Create the list to use for the option buttons. |
Orientation |
Set the orientation of the option buttons. |
Picture |
Customize the option button images. |
TextAlign |
Set how text aligns in the cell. |
UseMnemonic |
Set whether hot keys (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.
Display the list of several elements.
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; |
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 |
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.