DataGridViewCheckBoxCell
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Displays a CheckBox icon (not the actual control) in a DataGridViewCell cell.
- C#
- VB.NET
public class DataGridViewCheckBoxCell : DataGridViewCell
Public Class DataGridViewCheckBoxCell
Inherits DataGridViewCell
Constructors
DataGridViewCheckBoxCell()
Initializes a new instance of DataGridViewCheckBoxCell.
Properties
FalseValue
Object: Gets or sets the value that corresponds to false, which appears as an unchecked box. (Default: null)
FormattedValueType
Type: Returns the type of the formatted value associated with the cell.
IndeterminateValue
Object: Gets or sets the value that corresponds to indeterminate, which appears as an indeterminate box. (Default: null)
ThreeState
Boolean: Returns or sets a value indicating if the checkbox cell supports three states. (Default: False)
TrueValue
Object: Gets or sets the value that corresponds to true, which appears as checked box. (Default: null)
ValueType
Type: Returns or sets the data type of the values in the cell.
Methods
GetCellDataValue(cellStyle, includeVisualProperties)
Returns the data value of the cell. This is the value that is returned to the client in the data response stream.
| Parameter | Type | Description |
|---|---|---|
| cellStyle | DataGridViewCellStyle | The cell style in effect for the current cell, used to format the cell's value for the client rendering. |
| includeVisualProperties | Boolean | true to include inherited visual properties; otherwise, false to include only formatting properties. |
Returns: Object.
GetFormattedValue(value, cellStyle, valueTypeConverter, formattedTypeConverter)
Returns the value of the cell formatted for the client.
| Parameter | Type | Description |
|---|---|---|
| value | Object | The value to be formatted. |
| cellStyle | DataGridViewCellStyle | The DataGridViewCellStyle in for the cell. |
| valueTypeConverter | TypeConverter | A TypeConverter providing custom conversion from the formatted type to the value type, or null if no custom conversion is required. |
| formattedTypeConverter | TypeConverter | A TypeConverter providing custom conversion from the value type to the formatted type, or null if no custom conversion is required. |
Returns: Object. The value of the cell or null if the cell does not belong to a DataGridView control.
Throws:
- Exception Formatting failed and there is no handler for the DataError event of the DataGridView or the handler set the ThrowException property to true.
OnClick(e)
Raised when the user clicks on a cell. The DataGridCheckBoxCell class processes this event to determine the location of click and toggles the checkbox accordingly.
| Parameter | Type | Description |
|---|---|---|
| e | DataGridViewCellEventArgs | A DataGridViewCellEventArgs that contains the event data. |
OnKeyDown(e)
Raised when the user presses a key on the keyboard while the focus is on the table and not in edit mode.
| Parameter | Type | Description |
|---|---|---|
| e | KeyEventArgs |
ParseFormattedValue(value, cellStyle, formattedTypeConverter, valueTypeConverter)
Converts a value to the actual cell value.
| Parameter | Type | Description |
|---|---|---|
| value | Object | The display value of the cell. |
| cellStyle | DataGridViewCellStyle | The DataGridViewCellStyle in effect for the cell. |
| formattedTypeConverter | TypeConverter | A TypeConverter for the display value type, or null to use the default converter. |
| valueTypeConverter | TypeConverter | A TypeConverter for the cell value type, or null to use the default converter. |
Returns: Object. The cell value.
Throws:
- ArgumentNullException cellStyle is null.
- FormatException The FormattedValueType property value is null or the ValueType property value is null or value cannot be converted.
- ArgumentException value is null or the type of value does not match the type indicated by the FormattedValueType property.
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| ICommandSource | Defines an object that can invoke a Command. |