# DataGridViewCheckBoxCell

Namespace: **Wisej.Web**

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

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

Displays a [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox.md) icon (not the actual control) in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell.md) 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

### ![](/files/hsR4ok3152WyAf8J2C1u) DataGridViewCheckBoxCell()

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

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) 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`)

### ![](/files/hsR4ok3152WyAf8J2C1u) FormattedValueType

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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`)

### ![](/files/hsR4ok3152WyAf8J2C1u) 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`)

### ![](/files/hsR4ok3152WyAf8J2C1u) 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`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ValueType

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

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) 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** ![](/files/RboPbVYgUdZ2I6eDoFQj) | [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md) | 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).

### ![](/files/lzopMboA31bVq8UIcbT3) 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** ![](/files/RboPbVYgUdZ2I6eDoFQj) | [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md) | The [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md) 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](/api/wisej.web/lists-and-grids/datagridview.md) control.

**Throws:**

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs.md) | A [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs.md) that contains the event data. |

### ![](/files/hsR4ok3152WyAf8J2C1u) 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](/api/wisej.web/general/control/wisej.web.keyeventargs.md) |             |

### ![](/files/hsR4ok3152WyAf8J2C1u) 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](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md) | The [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md) 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](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell.md#formattedvaluetype) property value is null or the [ValueType](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell.md#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](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell.md#formattedvaluetype) property.

## Implements

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcheckboxcell.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
