# DataGridViewButtonColumn

Namespace: **Wisej.Web**

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

* [DataGridViewElement](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewelement.md)
  * [DataGridViewBand](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewband.md)
    * [DataGridViewColumn](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn.md)
      * [DataGridViewButtonColumn](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncolumn.md)

Represents a [DataGridView](/api/v3.0/wisej.web/lists-and-grids/datagridview.md) column that contains a collection of [DataGridViewButtonCell](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncell.md) 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

### ![](/files/uCY6T77rh488FWHzpJ6P)DataGridViewButtonColumn()

Initializes a new instance of the [DataGridViewButtonColumn](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncolumn.md) class to the default state.

### ![](/files/uCY6T77rh488FWHzpJ6P)DataGridViewButtonColumn(cellTemplate)

Initializes a new instance of the [DataGridViewButtonColumn](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncolumn.md) class to the default state.

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

## Properties

### ![](/files/uCY6T77rh488FWHzpJ6P)CellTemplate

[DataGridViewCell](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell.md): 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](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncell.md).

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

**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.

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

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.

### ![](/files/uCY6T77rh488FWHzpJ6P)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](/api/v3.0/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface. |
| [IWisejSerializable](/api/v3.0/wisej.core/interfaces/wisej.core.iwisejserializable.md) | Allows an object to serialize itself.          |


---

# 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/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncolumn.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.
