# ButtonColumn

The **DataGridViewButtonColumn** class is a specialized type of the **DataGridViewColumn** class used to logically host cells that respond to simple user input. A **DataGridViewButtonColumn** has an associated **DataGridViewButtonCell** in every **DataGridViewRow** that intersects it. Each cell supplies a user interface (UI) that is similar to a Button control.

To display the same button text for every cell, set the **UseColumnTextForButtonValue** property to `true` and set the **Text** property to the desired button text.

The default sort mode for this column type is `NotSortable`.

To respond to user button clicks, handle the **DataGridView\.CellClick** or **DataGridView\.CellContentClick** event. In the event handler, you can use the **DataGridViewCellEventArgs.ColumnIndex** property to determine whether the click occurred in the button column. You can use the **DataGridViewCellEventArgs.RowIndex** property to determine whether the click occurred in a button cell and not on the column header.

{% hint style="info" %}
For a full list of properties, methods and events see the [API documentation](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncolumn).
{% endhint %}


---

# 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/docs/controls/lists/datagridview/buttoncolumn.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.
