MultiRow Windows Forms > Developer's Guide > Using MultiRow > Cell Types > CheckBoxCell |
The check box cell offers features equivalent to the .NET Framework CheckBox control (System.Windows.Forms.CheckBox). The user can use this cell to enter ON and OFF values. The size of the check box depends upon Windows settings.
In addition to the Base Cell features, the following features can also be used in a check box cell.
For more details on each feature, refer to the CheckBoxCell class.
The check box cell uses the value object type and this type can be checked with the CheckBoxCell.ValueType property. The datatype used for input and display differs based on the value in the CheckBoxCell.ThreeState property. The value cast into the Boolean type is used when the ThreeState property is set to False. When the ThreeState property is True, the value cast into the System.Windows.Forms.CheckState type is used. These types can be checked with the CheckBoxCell.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 CheckBoxCell.OnCellFormatting method. The behavior when the value is written back from a cell can be modified by overriding the CheckBoxCell.OnCellParsing method.
The check box cell does not provide a cell edit control. The CheckBoxCell.EditType property always returns a null reference (Nothing in Visual Basic).
The check box cell supports the following members of the CellStyle class. You can set a cell style using the CheckBoxCell.Style property.
CellStyle Members | Enabled or Disabled |
BackColor | Enabled |
BackgroundGradientEffect | Enabled |
Border | Enabled |
DataSourceNullValue | Enabled |
DisabledBackColor | Enabled |
DisabledForeColor | Enabled |
DisabledGradientEffect | Enabled |
EditingBackColor | - |
EditingForeColor | - |
Font | Enabled |
ForeColor | Enabled |
Format | Enabled |
FormatProvider | Enabled |
Image | Enabled |
ImageAlign | Enabled |
ImeMode | - |
ImeSentenceMode | - |
InputScope | - |
LineAdjustment | Enabled only for GDI+ Compatible Mode |
Margin | Enabled |
MouseOverBackColor | Enabled |
MouseOverForeColor | Enabled |
MouseOverGradientEffect | Enabled |
Multiline | Enabled |
NullValue | Enabled |
Padding | Enabled |
PatternColor | Enabled |
PatternStyle | Enabled |
SelectionBackColor | Enabled |
SelectionForeColor | Enabled |
SelectionGradientEffect | Enabled |
Tag | Enabled |
TextAdjustment | Enabled only for GDI+ Compatible Mode |
TextAlign | Enabled |
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 set GDI+ Compatibility Mode as Enabled, set the UseCompatibleTextRendering property to True.
In a check box cell, Keys.Space is allocated for changing the check state and Keys.Control + Keys.C is allocated for clipboard processing. Keys other than these are processed by GcMultiRow.
You can use the GcMultiRow.CellContentClick event to implement the processing for any click in the cell content area. You can use the GcMultiRow.CellContentDoubleClick event to handle a double-click. Any change in the cell value fires a GcMultiRow.CellEditedFormattedValueChanged event.
The table below shows comparisons between major properties of the check box cell, the System.Windows.Forms.CheckBox control, and the System.Windows.Forms.DataGridViewCheckBoxCell.
CheckBoxCell | CheckBox | DataGridViewCheckBoxCell |
Appearance | Appearance | None |
CheckAlign | CheckAlign | Style.Alignment |
FalseValue | None | FalseValue |
FlatAppearance | FlatAppearance | None |
FlatStyle | FlatStyle | FlatStyle |
IndeterminateValue | None | IndeterminateValue |
Text | Text | None |
ThreeState | ThreeState | ThreeState |
TrueValue | None | TrueValue |
None | AutoCheck | None |
None | Checked | None |
None | CheckState | None |
Style.TextAlign | TextAlign | None |
Refer to the following for more information: