# DataGridViewCellEventArgs

Namespace: **Wisej.Web**

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

Provides data for [DataGridView](/api/wisej.web/lists-and-grids/datagridview.md) events related to cell and row operations.

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

```csharp
public class DataGridViewCellEventArgs : EventArgs
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Constructors

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

Initializes a new instance of the [DataGridViewCellEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventargs.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.    |

**Throws:**

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

## 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) Location

[Point](https://docs.microsoft.com/dotnet/api/system.drawing.point): Returns the location of the mouse or pointer event.

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

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns the internal role assigned to the element that generated the pointer event: checkbox, button, ...

The value in the Role property is taken from the "role" attribute of the clicked element inside the cell. You can detect clicks on custom HTML content by adding the role attribute to the custom element.

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

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the x-coordinate of the mouse or touch event.

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the y-coordinate of the mouse or touch event.

## Used By

| Name                                                                                                                  | Description                                                                                                                                      |
| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| [DataGridViewCellEventHandler](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventhandler.md) | Represents the method that will handle [DataGridView](/api/wisej.web/lists-and-grids/datagridview.md) events related to cell and row operations. |


---

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