# DataGridViewButtonColumn

Namespace: **Wisej.Web**

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

* [DataGridViewElement](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewelement)
  * [DataGridViewBand](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewband)
    * [DataGridViewColumn](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn)
      * [DataGridViewButtonColumn](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncolumn)

Represents a [DataGridView](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewButtonCell](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncell) cells.

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

```csharp
public class DataGridViewButtonColumn : DataGridViewColumn
```

{% endtab %}

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

```visual-basic
Public Class DataGridViewButtonColumn
    Inherits DataGridViewColumn
```

{% endtab %}
{% endtabs %}

## Constructors

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

Initializes a new instance of the [DataGridViewButtonColumn](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncolumn) class to the default state.

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

Initializes a new instance of the [DataGridViewButtonColumn](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncolumn) class to the default state.

| Name             | Type                                                                                                                              | Description                                                                                                                                                         |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **cellTemplate** | [DataGridViewButtonCell](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncell) | An existing [DataGridViewButtonCell](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncell) to use as a template. |

## Properties

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

[DataGridViewCell](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell): Returns or sets the template used to model cell appearance.

**Throws:**

* [InvalidOperationException](https://docs.microsoft.com/en-us/dotnet/api/system.invalidoperationexception) The type is null.
* [InvalidCastException](https://docs.microsoft.com/en-us/dotnet/api/system.invalidcastexception) The set type is not compatible with type [DataGridViewButtonCell](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncell).

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

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Gets or sets the default text displayed on the button cell when UseColumnTextForButtonValue is true. (Default: `""`)

**Throws:**

* [InvalidOperationException](https://docs.microsoft.com/en-us/dotnet/api/system.invalidoperationexception) When setting this property, the value of the [CellTemplate](#celltemplate) property is null.

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

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Gets or sets a value indicating if the button in the cell uses the owning column's text instead of the value of the cell. (Default: `False`)

This value is inherited by all the cells in the column that do not specify a value for this property. **Throws:**

* [InvalidOperationException](https://docs.microsoft.com/en-us/dotnet/api/system.invalidoperationexception) The property [CellTemplate](#celltemplate) is null.

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

[Type](https://docs.microsoft.com/en-us/dotnet/api/system.type): Returns or sets the data type of the values in the column's cells.

## Implements

| Name                                                                                                      | Description                                    |
| --------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| [IWisejComponent](https://docs.wisej.com/api/v3.1/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface. |
| [IWisejSerializable](https://docs.wisej.com/api/v3.1/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.          |
