Spread ASP.NET 6.0 Product Documentation
Setting a Multiple-Column Combo 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 Multiple-Column Combo Box Cell

Glossary Item Box

You can create a combo box cell with multiple columns in the drop-down list. You can provide a drop-down list and allow the user to choose from a displayed list. You specify the list of items by binding the cell. You can also choose which column is displayed in the edit area of the cell.

Multi Column Combo Cell

For details on the properties and methods for the multi-column combo box cell type, refer to the MultiColumnComboBoxCellType class in the Assembly Reference.

For details on the combo cell type, refer to the ComboBoxCellType class in the Assembly Reference.

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

Using Code

  1. Define the multi-column combo cell type by creating an instance of the MultiColumnComboBoxCellType class.
  2. Create a dataset.
  3. Specify the list of options by binding.
  4. Set the display properties such as ShowButton.
  5. Assign the cell type to a specific cell.

Example

Display a multi-column combo cell.

C# Copy Code
string conStr = "Provider=Microsoft.JET.OLEDB.4.0;data source= C:\\Patients2000.mdb";
string sqlStr = "SELECT * FROM Patients"; 
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(conStr); System.Data.DataSet ds = new System.Data.DataSet(); 
System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter(sqlStr, conn); da.Fill(ds); 
FarPoint.Web.Spread.CellType.MultiColumnComboBoxCellType mcombo = new FarPoint.Web.Spread.CellType.MultiColumnComboBoxCellType(); 
mcombo.DataSource = ds;
mcombo.DataColumnName = "Patients"; 
mcombo.ShowButton = True;
fpSpread1.Sheets[0].Cells[0, 0].CellType = mcombo;
VB Copy Code
Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source= C:\Common\Patients2000.mdb"
Dim sqlStr As String = "SELECT * FROM Patients"
Dim conn As New System.Data.OleDb.OleDbConnection(conStr)
Dim ds As System.Data.DataSet = New System.Data.DataSet()
Dim da As New System.Data.OleDb.OleDbDataAdapter(sqlStr, conn)
da.Fill(ds)
Dim mcombo As New FarPoint.Web.Spread.MultiColumnComboBoxCellType()
mcombo.DataSource = ds
mcombo.DataColumnName = "Patients"
mcombo.ShowButton = True
FpSpread1.Sheets(0).Cells(0, 0).CellType = mcombo

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.