Spread for ASP.NET 8.0 Product Documentation > Developer's Guide > Customizing with Cell Types > Working with Graphical Cell Types > Setting a List Box Cell |
A list box cell is a cell that displays a list of items when selected.
To create a cell that contains a list box, follow this procedure.
For details on the properties and methods for this cell type, refer to the ListBoxCellType class in the Assembly Reference.
Display the list of several elements.
C# |
Copy Code
|
---|---|
FarPoint.Web.Spread.ListBoxCellType lbcell = new FarPoint.Web.Spread.ListBoxCellType(); lbcell.Items = new String[] {"Carbon", "Oxygen", "Hydrogen"}; lbcell.SelectedBackColor = System.Drawing.Color.Yellow; lbcell.SelectedForeColor = System.Drawing.Color.DarkBlue; FpSpread1.ActiveSheetView.Cells[1, 1].CellType = lbcell; |
VB |
Copy Code
|
---|---|
Dim lbcell As New FarPoint.Web.Spread.ListBoxCellType() lbcell.Items = new String() {"Carbon", "Oxygen", "Hydrogen"} lbcell.SelectedBackColor = System.Drawing.Color.Yellow lbcell.SelectedForeColor = System.Drawing.Color.DarkBlue FpSpread1.ActiveSheetView.Cells(1, 1).CellType = lbcell |