# DataGridViewCheckBoxCell

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

* [DataGridViewElement](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewelement)
  * [DataGridViewCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell)
    * [DataGridViewCheckBoxCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcheckboxcell)

Displays a [CheckBox](https://docs.wisej.com/api/wisej.web/buttons/wisej.web.checkbox) icon (not the actual control) in a [DataGridViewCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell.

{% tabs %}
{% tab title="C#" %}

```csharp
public class DataGridViewCheckBoxCell : DataGridViewCell
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class DataGridViewCheckBoxCell
    Inherits DataGridViewCell
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) DataGridViewCheckBoxCell()

Initializes a new instance of [DataGridViewCheckBoxCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcheckboxcell).

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) FalseValue

[Object](https://docs.microsoft.com/dotnet/api/system.object): Gets or sets the value that corresponds to false, which appears as an unchecked box. (Default: `null`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) FormattedValueType

[Type](https://docs.microsoft.com/dotnet/api/system.type): Returns the type of the formatted value associated with the cell.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IndeterminateValue

[Object](https://docs.microsoft.com/dotnet/api/system.object): Gets or sets the value that corresponds to indeterminate, which appears as an indeterminate box. (Default: `null`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ThreeState

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value indicating if the checkbox cell supports three states. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TrueValue

[Object](https://docs.microsoft.com/dotnet/api/system.object): Gets or sets the value that corresponds to true, which appears as checked box. (Default: `null`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ValueType

[Type](https://docs.microsoft.com/dotnet/api/system.type): Returns or sets the data type of the values in the cell.

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) 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** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-912a3bc068ac1c69bcaa58145e4ee468ccd8a555%2Fbadge-byref.svg?alt=media) | [DataGridViewCellStyle](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) | The cell style in effect for the current cell, used to format the cell's value for the client rendering. |
| **includeVisualProperties**                                                                                                                                                                                              | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                                            | true to include inherited visual properties; otherwise, false to include only formatting properties.     |

**Returns:** [Object](https://docs.microsoft.com/dotnet/api/system.object).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) GetFormattedValue(value, cellStyle, valueTypeConverter, formattedTypeConverter)

Returns the value of the cell formatted for the client.

| Parameter                                                                                                                                                                                                                | Type                                                                                                                       | Description                                                                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **value**                                                                                                                                                                                                                | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                                              | The value to be formatted.                                                                                                                                                                                       |
| **cellStyle** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-912a3bc068ac1c69bcaa58145e4ee468ccd8a555%2Fbadge-byref.svg?alt=media) | [DataGridViewCellStyle](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) | The [DataGridViewCellStyle](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) in for the cell.                                                                  |
| **valueTypeConverter**                                                                                                                                                                                                   | [TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter)                                 | A [TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter) providing custom conversion from the formatted type to the value type, or null if no custom conversion is required. |
| **formattedTypeConverter**                                                                                                                                                                                               | [TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter)                                 | A [TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter) providing custom conversion from the value type to the formatted type, or null if no custom conversion is required. |

**Returns:** [Object](https://docs.microsoft.com/dotnet/api/system.object). The value of the cell or null if the cell does not belong to a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) control.

**Throws:**

* [Exception](https://docs.microsoft.com/dotnet/api/system.exception) Formatting failed and there is no handler for the [DataError](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/..#dataerror) event of the [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) or the handler set the [ThrowException](https://docs.wisej.com/api/wisej.web/lists-and-grids/wisej.web.datagridviewdataerroreventargs#throwexception) property to true.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) 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](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) | A [DataGridViewCellEventArgs](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) 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](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.keyeventargs) |             |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ParseFormattedValue(value, cellStyle, formattedTypeConverter, valueTypeConverter)

Converts a value to the actual cell value.

| Parameter                  | Type                                                                                                                       | Description                                                                                                                                                    |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **value**                  | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                                              | The display value of the cell.                                                                                                                                 |
| **cellStyle**              | [DataGridViewCellStyle](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) | The [DataGridViewCellStyle](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) in effect for the cell.         |
| **formattedTypeConverter** | [TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter)                                 | A [TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter) for the display value type, or null to use the default converter. |
| **valueTypeConverter**     | [TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter)                                 | A [TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter) for the cell value type, or null to use the default converter.    |

**Returns:** [Object](https://docs.microsoft.com/dotnet/api/system.object). The cell value.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *cellStyle* is null.
* [FormatException](https://docs.microsoft.com/dotnet/api/system.formatexception) The [FormattedValueType](https://docs.wisej.com/api/wisej.web/lists-and-grids/wisej.web.datagridviewcell#formattedvaluetype) property value is null or the [ValueType](https://docs.wisej.com/api/wisej.web/lists-and-grids/wisej.web.datagridviewcell#valuetype) property value is null or *value* cannot be converted.
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) *value* is null or the type of *value* does not match the type indicated by the [FormattedValueType](https://docs.wisej.com/api/wisej.web/lists-and-grids/wisej.web.datagridviewcell#formattedvaluetype) property.

## Implements

| Name                                                                                       | Description                                                                                                            |
| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| [IUserData](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.iuserdata)           | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface.        |
| [ICommandSource](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.icommandsource) | Defines an object that can invoke a [Command](https://docs.wisej.com/api/interfaces/wisej.web.icommandsource#command). |
