Spread ASP.NET 6.0 Product Documentation
Setting a List Box Cell
Send Feedback
Spread ASP.NET 6.0 Product Documentation > Developer's Guide > Customizing with Cell Types > Working with Graphical Cell Types > Setting a List Box Cell

Glossary Item Box

A list box cell is a cell that displays a list of items when selected.

List Box Cell Type with List

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.

Return to the overview of graphical cell types at Working with Graphical Cell Types.

Using Code

  1. Define the list box cell type by creating an instance of the ListBoxCellType class.
  2. Specify the list of items.
  3. Assign the list box cell type to a cell.

Example

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 = Color.Yellow; 
lbcell.SelectedForeColor = Color.DarkBlue; 
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = lbcell; 
VB Copy Code
Dim lbcell As New FarPoint.Web.Spread.ListBoxCellType()
lbcell.Items = new String() {"Carbon", "Oxygen", "Hydrogen"}
lbcell.SelectedBackColor = Color.Yellow
lbcell.SelectedForeColor = Color.DarkBlue
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = lbcell

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.
© 2002-2012 GrapeCity, Inc. All Rights Reserved.