Spread Windows Forms 11.0 Product Documentation
Setting a GcComboBox Cell
Spread Windows Forms 11.0 Product Documentation > Developer's Guide > Customizing Interaction with Cell Types > Working with Graphical Cell Types > Setting a GcComboBox Cell

You can use a GcComboBox cell to display a drop-down list and allow the user to choose items from the list. The GcComboBox cell also has a resize icon in the lower, right corner of the drop-down.

You can specify colors for each item in the combo cell or you can apply an item template. You can add items to the list with the Add method or add items by setting a data source. The GcComboBox cell also supports automatic completion.

Refer to the GcComboBoxCellType class for a complete list of properties and methods.

Example

This example creates a GcComboBox cell.

C#
Copy Code
GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType gccombo = new GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType();
gccombo.Items.Add("Gouda");
gccombo.Items.Add("Swiss");
gccombo.Items.Add("Brie");
gccombo.Items[0].BackColor = Color.Beige;
gccombo.Items[1].BackColor = Color.Cornsilk;
gccombo.Items[2].BackColor = Color.PeachPuff;
fpSpread1.Sheets[0].Cells[0, 0].CellType = gccombo;
VB
Copy Code
Dim gccombo As New GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType()
gccombo.Items.Add("Gouda")
gccombo.Items.Add("Swiss")
gccombo.Items.Add("Brie")
gccombo.Items(0).BackColor = Color.Beige
gccombo.Items(1).BackColor = Color.Cornsilk
gccombo.Items(2).BackColor = Color.PeachPuff
fpSpread1.Sheets(0).Cells(0, 0).CellType = gccombo

Using the Spread Designer

  1. Select the cell or cells in the work area.
  2. In the property list, in the Misc category, select CellType. From the drop-down list, choose the GcComboBox cell type. Now expand the CellType property and various properties are available that are specific to this cell type. Select and set those properties as needed.

    Or right-click on the cell or cells and select Cell Type. From the list, select GcComboBox. In the CellType editor, set the properties you need. Click Apply.

  3. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.