# DataGridViewRowCancelEventArgs

Namespace: **Wisej.Web**

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

Provides data for the [UserDeletingRow](/api/v3.1/wisej.web/lists-and-grids/datagridview.md#userdeletingrow) event of a [DataGridView](/api/v3.1/wisej.web/lists-and-grids/datagridview.md).

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

```csharp
public class DataGridViewRowCancelEventArgs : CancelEventArgs
```

{% endtab %}

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

```visual-basic
Public Class DataGridViewRowCancelEventArgs
    Inherits CancelEventArgs
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/QmRDluociuQ34KzBtOjf)DataGridViewRowCancelEventArgs(dataGrid, rowIndex)

Initializes a new instance of the [DataGridViewRowCancelEventArgs](/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrowcanceleventargs.md) class.

| Name         | Type                                                                | Description                                                                                                                                    |
| ------------ | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **dataGrid** | [DataGridView](/api/v3.1/wisej.web/lists-and-grids/datagridview.md) | DataGridView that owns the row.                                                                                                                |
| **rowIndex** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)   | The index of the [DataGridViewRow](/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow.md) that the event occurred for. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) *dataGrid* is null.
* [ArgumentOutOfRangeException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentoutofrangeexception) *rowIndex* is -1 or greater than the number of rows.

### ![](/files/QmRDluociuQ34KzBtOjf)DataGridViewRowCancelEventArgs(row)

Initializes a new instance of the [DataGridViewRowCancelEventArgs](/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrowcanceleventargs.md) class.

| Name    | Type                                                                                             | Description                                                                                                                       |
| ------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| **row** | [DataGridViewRow](/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow.md) | The [DataGridViewRow](/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow.md) that the event occurred for. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) *row* is null.

## Properties

### ![](/files/QmRDluociuQ34KzBtOjf)Row

[DataGridViewRow](/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow.md): Returns the [DataGridViewRow](/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow.md) that the user is deleting.

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

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32): Returns the index of the [DataGridViewRow](/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow.md) that the user is deleting.

## Used By

| Name                                                                                                                                 | Description                                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DataGridViewRowCancelEventHandler](/api/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrowcanceleventhandler.md) | Represents the method that will handle the [UserDeletingRow](/api/v3.1/wisej.web/lists-and-grids/datagridview.md#userdeletingrow) event of a [DataGridView](/api/v3.1/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/v3.1/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrowcanceleventargs.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.
