Spread for ASP.NET 8.0 Product Documentation > Developer's Guide > Customizing with Cell Types > Working with Graphical Cell Types > Setting a Check Box Cell |
A check box cell displays, by default, a small check box that can have one of two states, checked or unchecked. You can customize the check box by specifying the images for the two states. You can also specify whether the value is Boolean (true or false) or an integer (0 or 1). Default appearances are shown here.
To create a cell that acts like a check box, follow this procedure.
For details on the properties and methods for this cell type, refer to the CheckBoxCellType class in the Assembly Reference.
This example creates a check box cell with custom images and text.
C# |
Copy Code
|
---|---|
FarPoint.Web.Spread.CheckBoxCellType chkbx = new FarPoint.Web.Spread.CheckBoxCellType(); chkbx.Text = "Spotted"; chkbx.CheckedImageUrl = "img/checked.gif"; chkbx.UncheckedImageUrl = "img/unchecked.gif"; FpSpread1.ActiveSheetView.Cells[0, 0].CellType = chkbx; |
VB |
Copy Code
|
---|---|
Dim chkbx As New FarPoint.Web.Spread.CheckBoxCellType() chkbx.Text = "Spotted" chkbx.CheckedImageUrl = "img/checked.gif" chkbx.UncheckedImageUrl = "img/unchecked.gif" FpSpread1.ActiveSheetView.Cells(0, 0).CellType = chkbx |