MultiRow Windows Forms > Developer's Guide > Using MultiRow > Cell Types > ComboBoxCell |
The combo box cell provides features similar to the .NET Framework's ComboBox control (System.Windows.Forms.ComboBox). The user can use this combo box cell to enter a value from the drop-down list. The height of the combo box is automatically adjusted according to cell height.
In addition to the Base Cell features, the following features can also be used in the combo box cell.
For more details on each feature, refer to ComboBoxCell class.
The combo box cell uses the value Object type. The ComboBoxCell.ValueType property can be used to check the type. For input and display, a value cast into a String type is used, and this type can be checked with the ComboBoxCell.FormattedValueType property. The behavior during casting can be modified by overriding the ToString method of the Object type. To modify the behavior when values are read in a cell, you can override the ComboBoxCell.OnCellFormatting method. The behavior when the value is written back from the cell can be modified by overriding the ComboBoxCell.OnCellParsing method.
The combo box cell value is edited in the ComboBoxEditingControl. This control is inherited from the IEditingControl Interface and System.Windows.Forms.ComboBox class. The type of the cell edit control can be checked with the Cell.EditType property.
The combo box cell supports the following CellStyle class members. The cell style is set with the ComboBoxCell.Style property.
CellStyle Member | Non-Editable State | Editable State |
BackColor | Enabled | Enabled |
BackgroundGradientEffect | Enabled only when ComboBoxCell.FlatStyle is Flat or Popup. | - |
Border | Enabled | Enabled |
DataSourceNullValue | Enabled | Enabled |
DisabledBackColor | Enabled | - |
DisabledForeColor | Enabled only when ComboBoxCell.FlatStyle is Flat or Popup | - |
EditingBackColor | - | Enabled |
EditingForeColor | - | Enabled |
Font | Enabled | Enabled |
ForeColor | Enabled | Enabled |
Format | Enabled | Enabled |
FormatProvider | Enabled | Enabled |
Image | - | - |
ImageAlign | - | - |
ImeMode | Enabled | Enabled |
ImeSentenceMode | Enabled | Enabled |
InputScope | Enabled | Enabled |
LineAdjustment | Enabled only for GDI+Compatible Mode | - |
Margin | Enabled | - |
MouseOverBackColor | Enabled only when ComboBoxCell.FlatStyle is Flat or Popup | - |
MouseOverForeColor | Enabled | - |
MouseOverGradientEffect | Enabled only when ComboBoxCell.FlatStyle is Flat or Popup | - |
Multiline | Enabled | Enabled |
NullValue | Enabled | Enabled |
Padding | Enabled | Enabled |
PatternColor | Enabled | - |
PatternStyle | Enabled | - |
SelectionBackColor | Enabled only when ComboBoxCell.FlatStyle is Flat or Popup | - |
SelectionForeColor | Enabled | - |
SelectionGradientEffect | Enabled only when ComboBoxCell.FlatStyle is Flat or Popup | - |
Tag | Enabled | Enabled |
TextAdjustment | Enabled only for GDI+Compatible Mode | - |
TextAlign | Enabled | Horizontal Only |
TextAngle | Enabled only for GDI+Compatible Mode | - |
TextEffect | Enabled | - |
TextImageRelation | Enabled | - |
TextIndent | Enabled | - |
TextVertical | Enabled only for GDI+Compatible Mode | - |
UseCompatibleTextRendering | Enabled | - |
WordWrap | Enabled | - |
To enable the GDI+Compatible Mode, set the UseCompatibleTextRendering property to True.
The table below shows the list of keys processed when editing the combo box cell and the keys processed by the GcMultiRow control.
Modifier | Key | ComboBoxCell | GcMultiRow |
---|---|---|---|
None | Keys.PageUp | Enabled | - |
Keys.PageDown | Enabled | - | |
Keys.End | Enabled | - | |
Keys.Home | Enabled | - | |
Keys.Left | Enabled | - | |
Keys.Right | Enabled | - | |
Keys.Up | Enabled | - | |
Keys.Down | Enabled | - | |
Keys.Insert | - | - | |
Keys.Delete | Enabled | - | |
Keys.BackSpace | Enabled | - | |
Keys.F4 | Enabled | - | |
Keys.Control | Keys.PageUp | Enabled | - |
Keys.PageDown | Enabled | - | |
Keys.End | - | Enabled | |
Keys.Home | - | Enabled | |
Keys.Left | Enabled | - | |
Keys.Right | Enabled | - | |
Keys.Up | - | Enabled | |
Keys.Down | - | Enabled | |
Keys.A | Enabled | - | |
Keys.C | Enabled | - | |
Keys.V | Enabled | - | |
Keys.X | Enabled | - | |
Keys.Shift | Keys.Left | Enabled | - |
Keys.Right | Enabled | - | |
Keys.Up | Enabled | - | |
Keys.Down | Enabled | - | |
Keys.Home | Enabled | - | |
Keys.End | Enabled | - | |
Keys.Alt | Keys.Up | - | - |
Keys.Down | - | - |
When multiple cells are selected using Keys.Control + Keys.C, they are processed by the GcMultiRow control. The following keys are either not processed or are processed by the GcMultiRow control, if the ComboBoxCell.DropDownStyle property is set to MultiRowComboBoxStyle.DropDownList.
Modifier | Key | TextBoxCell | GcMultiRow |
---|---|---|---|
None | Keys.Delete | - | - |
Keys.BackSpace | - | - | |
Keys.Control | Keys.Left | - | Enabled |
Keys.Right | - | Enabled | |
Keys.V | - | - | |
Keys.X | - | - |
You can use the GcMultiRow.CellContentClick event to get a click in the cell content area. You can use the GcMultiRow.CellContentDoubleClick event for a double-click. Use the GcMultiRow.CellEditedFormattedValueChanged event to get any changes to the cell value. The ComboBoxEditingControl class events can be used to handle the processing of events when the combo box cell is being edited.
For more information see the following: