# DataGridViewCellEventArgs

Namespace: **Wisej.Web**

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

Provides data for [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) 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

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

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) 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.

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

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) 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.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) 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.

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

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) 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](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcelleventhandler) | Represents the method that will handle [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) events related to cell and row operations. |
