# DataGridViewCellCommandEventArgs

Namespace: **Wisej.Web**

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

Provides data for the [CellCommandNeeded](/api/wisej.web/lists-and-grids/datagridview.md#cellcommandneeded) event of the [DataGridView](/api/wisej.web/lists-and-grids/datagridview.md) control.

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

```csharp
public class DataGridViewCellCommandEventArgs : EventArgs
```

{% endtab %}

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

```visual-basic
Public Class DataGridViewCellCommandEventArgs
    Inherits EventArgs
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) DataGridViewCellCommandEventArgs(columnIndex, rowIndex, command)

Initializes a new instance of the [DataGridViewCellValueEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellvalueeventargs.md) class.

| Name            | Type                                                        | Description                                                            |
| --------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------- |
| **columnIndex** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The index of the column containing the cell that the event occurs for. |
| **rowIndex**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The index of the row containing the cell that the event occurs for.    |
| **command**     | [ICommand](/api/wisej.web/interfaces/wisej.web.icommand.md) | The current command or null.                                           |

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) *columnIndex* is less than 0; or *rowIndex* is less than 0.

## Properties

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns a value indicating the column index of the cell that the event occurs for.

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

[ICommand](/api/wisej.web/interfaces/wisej.web.icommand.md): Returns or sets the command of the cell that the event occurs for.

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns a value indicating the row index of the cell that the event occurs for.

## Used By

| Name                                                                                                                                | Description                                                                                                                                                                                                 |
| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DataGridViewCellCommandEventHandler](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellcommandeventhandler.md) | Represents the method that will handle the [CellCommandNeeded](/api/wisej.web/lists-and-grids/datagridview.md#cellcommandneeded) event of a [DataGridView](/api/wisej.web/lists-and-grids/datagridview.md). |


---

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