# DataGridViewCell

URL: https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell

Version: 4.1
Namespace: **Wisej.Web**

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

- [DataGridViewElement](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewelement)
- [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell)
Represents an individual cell in aDataGridView control.

- C# - VB.NET

```csharp
public class DataGridViewCell : DataGridViewElement, ICloneable, ICommandSource, IUserData
```

```visual
Public Class DataGridViewCell
    Inherits DataGridViewElement
    Implements ICloneable, ICommandSource, IUserData
```

## Constructors

### ![Instance member](/img/api/instance.png) DataGridViewCell()

Initializes a new instance of [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) .

## Properties

### ![Instance member](/img/api/instance.png) CellRenderer

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns the name of the cell renderer to use on the client side to render the cell. If it's null or empty, it defaults to "Cell".

The name of the cell renderer can be a fully qualified class name (i.e. "wisej.web.datagrid.cellRenderer.Cell") or just the class name (i.e. "ImageCell") in which case the client library prepends "wisej.web.datagrid.cellRenderer".

### ![Instance member](/img/api/instance.png) ColumnIndex

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Returns the column index for this cell.

### ![Instance member](/img/api/instance.png) Command

[ICommand](/api/wisej.web/interfaces/wisej.web.icommand) : Returns or sets the [ICommand](/api/wisej.web/interfaces/wisej.web.icommand) implementation to invoke. (Default: `null` )

### ![Instance member](/img/api/instance.png) ContextMenu

[ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu) : Returns or sets the shortcut menu associated with the cell. (Default: `null` )

### ![Instance member](/img/api/instance.png) Control

Control : Returns or sets a child control to display inside the cell.

### ![Instance member](/img/api/instance.png) DataGridView

DataGridView : Returns theDataGridView control associated with this [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) .

### ![Instance member](/img/api/instance.png) DefaultNewRowValue

[Object](https://docs.microsoft.com/dotnet/api/system.object) : Returns the default value for a cell in the row for new records.

### ![Instance member](/img/api/instance.png) Displayed

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns a value that indicates whether the cell is currently displayed.

### ![Instance member](/img/api/instance.png) Editable

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns whether the cell can be edited.

### ![Instance member](/img/api/instance.png) EditedFormattedValue

[Object](https://docs.microsoft.com/dotnet/api/system.object) : Returns the current, formatted value of the cell, regardless of whether the cell is in edit mode and the value has not been committed.

**Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The row containing the cell is a shared row; or the cell is a column header cell.
- [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception)[ColumnIndex](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#columnindex) is less than 0, indicating that the cell is a row header cell.
- [Exception](https://docs.microsoft.com/dotnet/api/system.exception) Formatting failed and either there is no handler for the [DataError](/api/wisej.web/lists-and-grids/datagridview/#dataerror) event of theDataGridView control or the handler set the [ThrowException](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdataerroreventargs#throwexception) property to true. The exception object can typically be cast to type [FormatException](https://docs.microsoft.com/dotnet/api/system.formatexception) .

### ![Instance member](/img/api/instance.png) EditType

[Type](https://docs.microsoft.com/dotnet/api/system.type) : Returns the type of the cell's hosted editing control.

### ![Instance member](/img/api/instance.png) ErrorText

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns or sets the text describing an error condition associated with the cell.

### ![Instance member](/img/api/instance.png) FormattedValue

[Object](https://docs.microsoft.com/dotnet/api/system.object) : Returns the value of the cell as formatted for display.

**Throws:**

- [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception)[ColumnIndex](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#columnindex) is less than 0, indicating that the cell is a row header cell.
- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The row containing the cell is a shared row; or the cell is a column header cell.
- [Exception](https://docs.microsoft.com/dotnet/api/system.exception) Formatting failed and either there is no handler for the [DataError](/api/wisej.web/lists-and-grids/datagridview/#dataerror) event of theDataGridView control or the handler set the [ThrowException](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdataerroreventargs#throwexception) property to true. The exception object can typically be cast to type [FormatException](https://docs.microsoft.com/dotnet/api/system.formatexception) .

### ![Instance member](/img/api/instance.png) FormattedValueType

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

### ![Protected member](/img/api/protected.png) FormattedValueTypeConverter

[TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter) : Returns the type converter to use to convert a formatted value to the cell's value type.

### ![Instance member](/img/api/instance.png) Frozen

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns a value indicating whether the cell is frozen.

### ![Instance member](/img/api/instance.png) HasStyle

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns true it the [Style](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#style) property has been set.

### ![Instance member](/img/api/instance.png) HasUserData

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Checks if the [UserData](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#userdata) dynamic object was created and has any value.

### ![Instance member](/img/api/instance.png) Height

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Returns the height of the cell.

### ![Instance member](/img/api/instance.png) InheritedState

[DataGridViewElementStates](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewelementstates) : Returns the current state of the cell as inherited from the state of its row and column.

**Throws:**

- [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The cell is not contained within aDataGridView control and the value of its [RowIndex](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#rowindex) property is not -1.
- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The cell is contained within aDataGridView control and the value of its [RowIndex](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#rowindex) property is -1.

### ![Instance member](/img/api/instance.png) InheritedStyle

[DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) : Returns the style currently applied to the cell.

**Throws:**

- [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception) The cell does not belong to aDataGridView control; or [ColumnIndex](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#columnindex) is less than 0, indicating that the cell is a row header cell.
- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The row containing the cell is a shared row; or the cell is a column header cell.

### ![Instance member](/img/api/instance.png) IsCurrentCell

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns whether this is the current cell in the [DataGridView](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#datagridview) .

### ![Instance member](/img/api/instance.png) IsInEditMode

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns a value indicating whether this cell is currently being edited.

### ![Instance member](/img/api/instance.png) OwningColumn

[DataGridViewColumn](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn) : Returns the column that contains this cell.

### ![Instance member](/img/api/instance.png) OwningRow

[DataGridViewRow](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow) : Returns the row that contains this cell.

### ![Instance member](/img/api/instance.png) ReadOnly

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets whether the cell's data can be edited.

### ![Instance member](/img/api/instance.png) Resizable

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns a value indicating whether the cell can be resized.

### ![Instance member](/img/api/instance.png) RowIndex

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Returns the index of the cell's parent row.

### ![Instance member](/img/api/instance.png) Selected

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets whether the cell has been selected.

### ![Instance member](/img/api/instance.png) Size

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size) : Returns the size of the cell.

### ![Instance member](/img/api/instance.png) Style

[DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) : Returns or sets the style for the cell.

### ![Instance member](/img/api/instance.png) Tag

[Object](https://docs.microsoft.com/dotnet/api/system.object) : Returns or sets the object that contains supplemental data about the cell. (Default: `null` )

### ![Instance member](/img/api/instance.png) ToolTipText

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns or sets the ToolTip text associated with this cell.

### ![Instance member](/img/api/instance.png) UserData

[Object](https://docs.microsoft.com/dotnet/api/system.object) : Returns a dynamic object that can be used to store custom data in relation to this cell.

### ![Instance member](/img/api/instance.png) UserPaint

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Enables or disables the user paint feature for this cell. When UserPaint is true, the application can handle the [CellPaint](/api/wisej.web/lists-and-grids/datagridview/#cellpaint) event to draw custom content in the cell. (Default: `False` )

### ![Instance member](/img/api/instance.png) Value

[Object](https://docs.microsoft.com/dotnet/api/system.object) : Returns or sets the value associated with this cell.

**Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)[RowIndex](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#rowindex) is outside the valid range of 0 to the number of rows in the control minus 1.
- [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception)[ColumnIndex](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#columnindex) is less than 0, indicating that the cell is a row header cell.

### ![Instance member](/img/api/instance.png) ValueType

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

### ![Protected member](/img/api/protected.png) ValueTypeConverter

[TypeConverter](https://docs.microsoft.com/dotnet/api/system.componentmodel.typeconverter) : Return the type converter to use to convert the value in the cell to the formatted value.

### ![Instance member](/img/api/instance.png) Visible

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns a value indicating whether the cell is in a row or column that has been hidden.

### ![Instance member](/img/api/instance.png) Width

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Returns the width of the cell.

## Methods

### ![Instance member](/img/api/instance.png) Clone()

Creates a copy of this cell.

**Returns:**[DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) . The cloned [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) .

### ![Protected member](/img/api/protected.png) CompareValue(newValue, oldValue)

Compares the new value being assigned to the cell with the previous value.

| Parameter | Type | Description | **newValue** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | New value being assigned to the cell. | **oldValue** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Current value assigned to the cell being replaced by *newValue* 

**Returns:**[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) . `true` if *newValue* and *oldValue* are different.

### ![Instance member](/img/api/instance.png) CreateEditingControl()

Creates a new instance of the edit control used to edit values in this cell.

**Returns:**Control .

### ![Protected member](/img/api/protected.png) Dispose(disposing)

Releases the resources used by the [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) .

| Parameter | Type | Description | **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true when this method is called by the application rather than a finalizer. 

### ![Protected member](/img/api/protected.png) GetClipboardContent(rowIndex, firstCell, lastCell, inFirstRow, inLastRow, format)

Returns the formatted value of the cell to copy to the [Clipboard](/api/wisej.web/general/wisej.web.clipboard) .

| Parameter | Type | Description | **rowIndex** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The zero-based index of the row containing the cell. | **firstCell** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true to indicate that the cell is in the first column of the region defined by the selected cells; otherwise, false. | **lastCell** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true to indicate that the cell is the last column of the region defined by the selected cells; otherwise, false. | **inFirstRow** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true to indicate that the cell is in the first row of the region defined by the selected cells; otherwise, false. | **inLastRow** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true to indicate that the cell is in the last row of the region defined by the selected cells; otherwise, false. | **format** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The current format string of the cell. 

**Returns:**[Object](https://docs.microsoft.com/dotnet/api/system.object) . An [Object](https://docs.microsoft.com/dotnet/api/system.object) that represents the value of the cell to copy to the [Clipboard](/api/wisej.web/general/wisej.web.clipboard) .

**Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)*rowIndex* is less than 0 or greater than or equal to the number of rows in the control.
- [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception) The value of the cell's [DataGridView](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewelement#datagridview) property is null.-or- [ColumnIndex](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#columnindex) is less than 0, indicating that the cell is a row header cell.
- [Exception](https://docs.microsoft.com/dotnet/api/system.exception) Formatting failed and either there is no handler for the [DataError](/api/wisej.web/lists-and-grids/datagridview/#dataerror) event of theDataGridView control or the handler set the [ThrowException](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdataerroreventargs#throwexception) property to true. The exception object can typically be cast to type [FormatException](https://docs.microsoft.com/dotnet/api/system.formatexception) .

### ![Protected member](/img/api/protected.png) GetCommand()

Returns the command bound to the cell.

**Returns:**[ICommand](/api/wisej.web/interfaces/wisej.web.icommand) . The value contained in the [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) .

### ![Instance member](/img/api/instance.png) GetEditedFormattedValue()

Returns the current, formatted value of the cell, regardless the cell being in edit mode.

**Returns:**[Object](https://docs.microsoft.com/dotnet/api/system.object) . The current, formatted value of the [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) .

**Throws:**

- [Exception](https://docs.microsoft.com/dotnet/api/system.exception) Formatting failed and either there is no handler for the [DataError](/api/wisej.web/lists-and-grids/datagridview/#dataerror) event of theDataGridView control or the handler set the [ThrowException](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdataerroreventargs#throwexception) property to true. The exception object can typically be cast to type [FormatException](https://docs.microsoft.com/dotnet/api/system.formatexception) .

### ![Protected member](/img/api/protected.png) GetErrorText()

Returns a string that represents the error for the cell.

**Returns:**[String](https://docs.microsoft.com/dotnet/api/system.string) . A string that describes the error for the current [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) .

### ![Protected member](/img/api/protected.png) 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**![by reference](/img/api/badge-byref.svg) | [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) | The [DataGridViewCellStyle](/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 aDataGridView 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/#dataerror) event of theDataGridView or the handler set the [ThrowException](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdataerroreventargs#throwexception) property to true.

### ![Instance member](/img/api/instance.png) GetInheritedContextMenu()

Returns the inherited [ContextMenu](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#contextmenu) for the current cell.

**Returns:**[ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu) . A [ContextMenu](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#contextmenu) instance if the [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) , or the owner [DataGridViewRow](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow) , or the owner [DataGridViewColumn](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn) , or the ownerDataGridView has a [ContextMenu](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#contextmenu) assigned; otherwise, null.

### ![Instance member](/img/api/instance.png) GetInheritedState()

Returns a value indicating the current state of the cell as inherited from the state of its row and column.

**Returns:**[DataGridViewElementStates](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewelementstates) . A combination of [DataGridViewElementStates](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewelementstates) values representing the current state of the cell.

### ![Instance member](/img/api/instance.png) GetInheritedStyle(includeVisualProperties)

Returns the style applied to the cell.

| Parameter | Type | Description | **includeVisualProperties** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true to include inherited visual properties; otherwise, false to include only formatting properties. 

**Returns:**[DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) . A [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) that includes the style settings of the cell inherited from the cell's parent row, column, andDataGridView .

**Throws:**

- [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception) The cell has no associatedDataGridView .

### ![Protected member](/img/api/protected.png) GetToolTipText()

Returns a string that represents the tooltip text for the cell.

**Returns:**[String](https://docs.microsoft.com/dotnet/api/system.string) . A string that describes the tooltip text for the current [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) .

### ![Protected member](/img/api/protected.png) GetValue()

Returns the value of the cell.

**Returns:**[Object](https://docs.microsoft.com/dotnet/api/system.object) . The value contained in the [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) .

### ![Instance member](/img/api/instance.png) InitializeEditingControl(editor, style)

Initializes the control used to edit the cell.

| Parameter | Type | Description | **editor** | Control | TheControl that is used to edit the cell. | **style** | [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) | The [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle) that is in effect for the cell entering edit mode. 

**Throws:**

- [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)*editor* is null.

### ![Instance member](/img/api/instance.png) OnCellFormatting(e)

Raised when the contents of a cell need to be formatted for display.

| Parameter | Type | Description | **e** | [DataGridViewCellFormattingEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellformattingeventargs) | A [DataGridViewCellFormattingEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellformattingeventargs) that contains the event data. 

### ![Instance member](/img/api/instance.png) OnClick(e)

Raised when the user clicks on a cell.

| Parameter | Type | Description | **e** | [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) | A [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) that contains the event data. 

### ![Protected member](/img/api/protected.png) OnDataGridViewChanged()

Called when the element is associated with a differentDataGridView .

### ![Instance member](/img/api/instance.png) OnDoubleClick(e)

Raised when the user double-clicks on a cell.

| Parameter | Type | Description | **e** | [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) | A [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) that contains the event data. 

### ![Instance member](/img/api/instance.png) OnEnter(e)

Raised when the cell becomes the active cell.

| Parameter | Type | Description | **e** | [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) | A [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) that contains the event data. 

### ![Instance member](/img/api/instance.png) OnKeyDown(e)

Raised when the user types on the keyboard while the grid has the focus and it's not in edit more.

| Parameter | Type | Description | **e** | [KeyEventArgs](/api/wisej.web/general/control/wisej.web.keyeventargs) | A [KeyEventArgs](/api/wisej.web/general/control/wisej.web.keyeventargs) that contains the event data. 

### ![Instance member](/img/api/instance.png) OnLeave(e)

Raised when the cell is not the active cell anymore.

| Parameter | Type | Description | **e** | [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) | A [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) that contains the event data. 

### ![Instance member](/img/api/instance.png) OnMouseClick(e)

Raised when the user clicks or taps on a cell.

| Parameter | Type | Description | **e** | [DataGridViewCellMouseEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellmouseeventargs) | A [DataGridViewCellMouseEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellmouseeventargs) that contains the event data. 

### ![Instance member](/img/api/instance.png) OnMouseDoubleClick(e)

Raised when the user double-clicks or double-taps on a cell.

| Parameter | Type | Description | **e** | [DataGridViewCellMouseEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellmouseeventargs) | A [DataGridViewCellMouseEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellmouseeventargs) that contains the event data. 

### ![Instance member](/img/api/instance.png) 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) | The [DataGridViewCellStyle](/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](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#formattedvaluetype) property value is null or the [ValueType](/api/wisej.web/lists-and-grids/datagridview/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](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#formattedvaluetype) property.

### ![Protected member](/img/api/protected.png) RaiseCellCommandChanged(e)

Fires the [CellCommandChanged](/api/wisej.web/lists-and-grids/datagridview/#cellcommandchanged) event.

| Parameter | Type | Description | **e** | [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) | A [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs) that contains the event data. 

### ![Instance member](/img/api/instance.png) ResetReadOnly()

Resets the [ReadOnly](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#readonly) state to inherit its value from the [OwningColumn](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#owningcolumn) , [OwningRow](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#owningrow) and the [DataGridView](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell#datagridview) .

### ![Protected member](/img/api/protected.png) SetCommand(command)

Sets the command for the cell.

| Parameter | Type | Description | **command** | [ICommand](/api/wisej.web/interfaces/wisej.web.icommand) | The cell command to set. 

**Returns:**[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) . True if the value has been set, otherwise false.

### ![Protected member](/img/api/protected.png) SetValue(value)

Sets the value of the cell.

| Parameter | Type | Description | **value** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | The cell value to set. 

**Returns:**[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) . True if the value has been set, otherwise false.

### ![Instance member](/img/api/instance.png) ShouldUpdate()

Indicates whether the cell data should be updated on the client even if the user didn't change the value when editing. Since 3.2.5

**Returns:**[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) . true to force the cell to update the client.

Used to allow the server to update the cell after editing mode is terminated and the user didn't change anything. For example, a password cell can be obfuscated, or a custom cell may need to always format the rendered value when terminating edit mode.

### ![Instance member](/img/api/instance.png) Update()

Updates the cell on the client.

## Inherited By

| Name | Description | [DataGridViewButtonCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncell) | Displays a button widget in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell. | [DataGridViewCheckBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcheckboxcell) | Displays a [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) icon (not the actual control) in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell. | [DataGridViewComboBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcomboboxcell) | Displays an editableComboBox control in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell when in edit mode. | [DataGridViewDateTimePickerCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdatetimepickercell) | Displays an editable [DateTimePicker](/api/wisej.web/editors/wisej.web.datetimepicker) control in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell when in edit mode. | [DataGridViewImageCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewimagecell) | Displays an image in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell. | [DataGridViewLinkCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewlinkcell) | Displays a link widget in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell. | [DataGridViewMaskedTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewmaskedtextboxcell) | Displays an editableMaskedTextBox control in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell when in edit mode. | [DataGridViewNumericUpDownCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewnumericupdowncell) | Displays an editable [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown) control in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell when in edit mode. | [DataGridViewTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell) | Displays an editable [TextBox](/api/wisej.web/editors/wisej.web.textbox) control in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell) cell when in edit mode. | [DataGridViewColumnHeaderCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumnheadercell) | Represents a column header in aDataGridView control. | [DataGridViewHeaderCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewheadercell) | Contains functionality common to row header cells and column header cells. | [DataGridViewRowHeaderCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrowheadercell) | Represents a row header of aDataGridView control. 

## Implements

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