# DataGridViewCellPaintEventArgs

Namespace: **Wisej.Web**

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

* [PaintEventArgs](https://docs.wisej.com/api/v2.5/wisej.web/general/control/wisej.web.painteventargs)
  * [DataGridViewCellPaintEventArgs](https://docs.wisej.com/api/v2.5/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellpainteventargs)

Provides data for [CellPaint](https://docs.wisej.com/api/v2.5/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellpainteventargs) event.

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

```csharp
public class DataGridViewCellPaintEventArgs : PaintEventArgs
```

{% endtab %}

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

```visual-basic
Public Class DataGridViewCellPaintEventArgs
    Inherits PaintEventArgs
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)DataGridViewCellPaintEventArgs(columnIndex, rowIndex, graphics, clipRect)

Initializes a new instance of the [DataGridViewCellPaintEventArgs](https://docs.wisej.com/api/v2.5/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellpainteventargs) class.

| Name            | Type                                                                              | Description                                                                                                                            |
| --------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **columnIndex** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                 | The index of the column containing the cell that the event occurs for.                                                                 |
| **rowIndex**    | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                 | The index of the row containing the cell that the event occurs for.                                                                    |
| **graphics**    | [Graphics](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.graphics)   | The [Graphics](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.graphics) used to paint the item.                            |
| **clipRect**    | [Rectangle](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.rectangle) | The [Rectangle](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.rectangle) that represents the rectangle in which to paint. |

**Throws:**

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

## Properties

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)ColumnIndex

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

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)RowIndex

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

## Used By

| Name                                                                                                                                                    | Description                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DataGridViewCellPaintEventHandler](https://docs.wisej.com/api/v2.5/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellpainteventhandler) | Represents the method that will handle [CellPaint](https://docs.wisej.com/api/v2.5/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellpainteventargs) events. |


---

# 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/v2.5/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellpainteventargs.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.
