# DataGridViewCellFormattingEventArgs

Namespace: **Wisej.Web**

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

* [ConvertEventArgs](/api/wisej.web/data-binding/wisej.web.converteventargs.md)
  * [DataGridViewCellFormattingEventArgs](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellformattingeventargs.md)

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

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

```csharp
public class DataGridViewCellFormattingEventArgs : ConvertEventArgs
```

{% endtab %}

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

```visual-basic
Public Class DataGridViewCellFormattingEventArgs
    Inherits ConvertEventArgs
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) DataGridViewCellFormattingEventArgs(columnIndex, rowIndex, value, desiredType, cellStyle)

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

| Name            | Type                                                                                                    | Description                                         |
| --------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| **columnIndex** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                             | The column index of the cell that caused the event. |
| **rowIndex**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                             | The row index of the cell that caused the event.    |
| **value**       | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                           | The cell's contents.                                |
| **desiredType** | [Type](https://docs.microsoft.com/dotnet/api/system.type)                                               | The type to convert *value* to.                     |
| **cellStyle**   | [DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md) | The style of the cell that caused the event.        |

**Throws:**

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

## Properties

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

[DataGridViewCellStyle](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md): Returns or sets the style of the cell that is being formatted.

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the column index of the cell that is being formatted.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the cell value has been successfully formatted.

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the row index of the cell that is being formatted.

## Used By

| Name                                                                                                                                      | Description                                                                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DataGridViewCellFormattingEventHandler](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellformattingeventhandler.md) | Represents the method that will handle the [CellFormatting](/api/wisej.web/lists-and-grids/datagridview.md#cellformatting) 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.datagridviewcellformattingeventargs.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.
