GrapeCity MultiRow Windows Forms Documentation
ComboBoxCell Class
Members  Example 


Represents a Cell that displays a combo box user interface in a GcMultiRow control.
Object Model
ComboBoxCell ClassGcMultiRow ClassCellStyle ClassComboBoxCell.ObjectCollection ClassCellNote ClassSection ClassCellStyle ClassMultiRowTouchToolBar ClassValidatorCollection ClassCellValidator Class
Syntax
<ToolboxBitmapAttribute()>
<SRDescriptionAttribute("Displays a text box with a drop-down list.")>
<ToolboxItemFilterAttribute(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom Or  _
    ToolboxItemFilterType.Prevent Or  _
    ToolboxItemFilterType.Require)>
<DefaultPropertyAttribute("Items")>
Public Class ComboBoxCell 
   Inherits ListCell
Dim instance As ComboBoxCell
[ToolboxBitmap()]
[SRDescription("Displays a text box with a drop-down list.")]
[ToolboxItemFilter(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom | 
    ToolboxItemFilterType.Prevent | 
    ToolboxItemFilterType.Require)]
[DefaultProperty("Items")]
public class ComboBoxCell : ListCell 
Remarks

The ComboBoxCell class is a special type of Cell used to display a ComboBox control, Users can edit the cell's value by selecting an item in the combo box's drop-down list. The currently selected ComboBoxCell hosts a ComboBoxEditingControl in which the user can edit the cell's value.

Notes to Inheritors:

When you derive from ComboBoxCell and add new properties to the derived class, be sure to override the Clone method to copy the new properties during cloning operations. You should also call the base class's Clone method so that the properties of the base class are copied to the new cell.

Example
The following code example shows how to use the combo box cell and customize the properties of this cell.
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;

namespace GrapeCity.Win.MultiRow.SampleCode
{
    public class ComboBoxCellDemo : Form
    {
        private GcMultiRow gcMultiRow1 = new GcMultiRow();
        
        private Label descriptionLable = new Label();

        public ComboBoxCellDemo()
        {
            this.Text = "ComboBoxCell Demo";
            this.Size = new Size(400, 300);

            // Add MultiRow to form
            this.gcMultiRow1.Dock = DockStyle.Fill;
            this.Controls.Add(this.gcMultiRow1);

            descriptionLable.Height = 40;
            descriptionLable.BackColor = SystemColors.Info;
            descriptionLable.Dock = DockStyle.Bottom;
            this.Controls.Add(descriptionLable);

            this.gcMultiRow1.CellEnter += new EventHandler<CellEventArgs>(gcMultiRow1_CellEnter);
            this.Load += new EventHandler(Form1_Load);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // create a template with 4 combo box cell columns.
            ComboBoxCell unboundComboCell = this.CreateCommonComboBoxCell();

            ComboBoxCell dataBindingComboCell = this.CreateDatabindingComboBoxCell();

            ComboBoxCell autoCompleteComboCell = this.CreateAutoCompleteComboBoxCell();

            ComboBoxCell hiddenDropDownButtonComboCell = this.CreateComboBoxCellHiddenDropDownButton();

            Cell[] comboBoxCells = new Cell[] { unboundComboCell, dataBindingComboCell, autoCompleteComboCell, hiddenDropDownButtonComboCell };

            this.gcMultiRow1.Template = Template.CreateGridTemplate(comboBoxCells);

            this.gcMultiRow1.ColumnHeaders[0][0].Value = "Common";
            this.gcMultiRow1.ColumnHeaders[0][1].Value = "Databinding";
            this.gcMultiRow1.ColumnHeaders[0][2].Value = "AutoComplete";
            this.gcMultiRow1.ColumnHeaders[0][3].Value = "Hide Button";

            this.gcMultiRow1.RowCount = 6;
        }
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Data
Imports GrapeCity.Win.MultiRow

Public Class ComboBoxCellDemo
    Inherits Form
    Friend WithEvents gcMultiRow1 As New GcMultiRow()

    Private descriptionLable As New Label()

    Public Sub New()
        Me.Text = "ComboBoxCell Demo"
        Me.Size = New Size(400, 300)

        ' Add MultiRow to form
        Me.gcMultiRow1.Dock = DockStyle.Fill
        Me.Controls.Add(Me.gcMultiRow1)

        descriptionLable.Height = 40
        descriptionLable.BackColor = SystemColors.Info
        descriptionLable.Dock = DockStyle.Bottom
        Me.Controls.Add(descriptionLable)
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        ' create a template with 4 combo box cell columns.
        Dim unboundComboCell As ComboBoxCell = Me.CreateCommonComboBoxCell()

        Dim dataBindingComboCell As ComboBoxCell = Me.CreateDatabindingComboBoxCell()

        Dim autoCompleteComboCell As ComboBoxCell = Me.CreateAutoCompleteComboBoxCell()

        Dim hiddenDropDownButtonComboCell As ComboBoxCell = Me.CreateComboBoxCellHiddenDropDownButton()

        Dim comboBoxCells As Cell() = New Cell() {unboundComboCell, dataBindingComboCell, autoCompleteComboCell, hiddenDropDownButtonComboCell}

        Me.gcMultiRow1.Template = Template.CreateGridTemplate(comboBoxCells)

        Me.gcMultiRow1.ColumnHeaders(0)(0).Value = "Common"
        Me.gcMultiRow1.ColumnHeaders(0)(1).Value = "Databinding"
        Me.gcMultiRow1.ColumnHeaders(0)(2).Value = "AutoComplete"
        Me.gcMultiRow1.ColumnHeaders(0)(3).Value = "Hide Button"

        Me.gcMultiRow1.RowCount = 6
    End Sub
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         GrapeCity.Win.MultiRow.Cell
            GrapeCity.Win.MultiRow.ListCell
               GrapeCity.Win.MultiRow.ComboBoxCell

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ComboBoxCell Members
GrapeCity.Win.MultiRow Namespace
Cell Class
ComboBoxEditingControl Class

 

 


Copyright © GrapeCity, inc. All rights reserved.