# DataGridViewCellFormattingEventArgs

Namespace: **Wisej.Web**

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

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

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

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

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

{% endtab %}

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

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

{% 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) DataGridViewCellFormattingEventArgs(columnIndex, rowIndex, value, desiredType, cellStyle)

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

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

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

### ![](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 the column index of the cell that is being formatted.

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

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

### ![](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 the row index of the cell that is being formatted.

## Used By

| Name                                                                                                                                                         | Description                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DataGridViewCellFormattingEventHandler](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellformattingeventhandler) | Represents the method that will handle the [CellFormatting](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/..#cellformatting) event of a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview). |
