# DataGridViewTextBoxCell

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)
    * [DataGridViewTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell.md)

Displays an editable [TextBox](/api/wisej.web/editors/wisej.web.textbox.md) control in a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell.md) cell when in edit mode.

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

```csharp
public class DataGridViewTextBoxCell : DataGridViewCell
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Constructors

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

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

## Properties

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether pressing ENTER in a [Multiline](#multiline)[DataGridViewTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell.md) creates a new line of text or terminates edit mode. (Default: `False`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether pressing the TAB key in a multiline text box control types a TAB character in the control instead of moving the focus to the next control in the tab order. (Default: `False`)

The [Multiline](#multiline) property must be true to get a TAB character in the control.\
If the [AcceptsTab](#acceptstab) property is set to true, the user can press SHIFT+TAB to move the focus to the next control in the tab order.

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

[AutoComplete](/api/wisej.web/enumerations/wisej.web.autocomplete.md): Returns or sets whether the browser can auto complete the field with values previously entered by the user.

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

[String\[\]](https://docs.microsoft.com/dotnet/api/system.string): Identifies a list of pre-defined options to suggest to the user.

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

[CharacterCasing](/api/wisej.web/editors/wisej.web.charactercasing.md): Returns or sets whether the cell editor modifies the case of characters as they are typed. (Default: `Normal`)

### ![](/files/lIX317sDtMTZJBi9oSIx) DefaultPasswordText

[String](https://docs.microsoft.com/dotnet/api/system.string): Defines the default text to display in a [DataGridViewTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell.md) cell when the [Type](/api/wisej.web/editors/wisej.web.inputtype.md#type) property is set to [Password](/api/wisej.web/editors/wisej.web.textboxtype.md#fields).<mark style="color:blue;background-color:green;">Since 3.2.5</mark>

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

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

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

[InputType](/api/wisej.web/editors/wisej.web.inputtype.md): Specifies the type, min, max and step properties to associate to the \<input> element.

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the maximum number of characters that can be entered into the cell editor. (Default: `0`)

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The value is less than 0.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether this is a multiline text box control. (Default: `False`)

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The property cannot be modified after the component has been created.

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

[ComponentToolCollection](/api/wisej.web/editors/wisej.web.componenttoolcollection.md): Returns the instance of [ComponentToolCollection](/api/wisej.web/editors/wisej.web.componenttoolcollection.md) associated with this cell.

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

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

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

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the text to show when the textbox is empty.

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) GetCellDataValue(cellStyle, includeVisualProperties)

| Parameter                                      | Type                                                                                                    | Description |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------- |
| **cellStyle** ![](/files/RboPbVYgUdZ2I6eDoFQj) | [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md) |             |
| **includeVisualProperties**                    | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                         |             |

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

### ![](/files/hsR4ok3152WyAf8J2C1u) InitializeEditingControl(editor, style)

Initializes the control used to edit the cell.

| Parameter  | Type                                                                                                    | Description                                                                                                                                                    |
| ---------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **editor** | [Control](/api/wisej.web/general/control.md)                                                            | The [Control](/api/wisej.web/general/control.md) that is used to edit the cell.                                                                                |
| **style**  | [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) that is in effect for the cell entering edit mode. |

**Throws:**

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

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

Resets the [InputType](#inputtype) property.

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

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

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

## 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.datagridviewtextboxcell.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.
