# DataGridViewBand

Namespace: **Wisej.Web**

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

* [DataGridViewElement](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewelement)
  * [DataGridViewBand](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewband)

Represents a linear collection of elements in a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) control.

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

```csharp
public class DataGridViewBand : DataGridViewElement, ICloneable, IUserData
```

{% endtab %}

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

```visual-basic
Public Class DataGridViewBand
    Inherits DataGridViewElement
    Implements ICloneable, IUserData
```

{% endtab %}
{% endtabs %}

## 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) ContextMenu

[ContextMenu](https://docs.wisej.com/api/wisej.web/menus/wisej.web.contextmenu): Returns or sets the shortcut menu for the row or the column object. (Default: `null`)

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

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

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

[Type](https://docs.microsoft.com/dotnet/api/system.type): Returns or sets the run-time type of the default header cell.

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The specified value when setting this property is not a [Type](https://docs.microsoft.com/dotnet/api/system.type) representing [DataGridViewHeaderCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewheadercell) or a derived type.

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the default minimum size for the band (row or column.)

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the default size for the band (row or column.)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns a value indicating whether the band is currently displayed on screen.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the band will move when a user scrolls through the [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview). (Default: `False`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns a value indicating whether the [DefaultCellStyle](#defaultcellstyle) property has been set.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Checks if the [UserData](#userdata) dynamic object was created and has any value.

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

[DataGridViewHeaderCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewheadercell): Returns or sets the header cell of the [DataGridViewBand](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewband).

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The specified value when setting this property is not a [DataGridViewRowHeaderCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrowheadercell) and this [DataGridViewBand](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewband) instance is of type [DataGridViewRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow); or the specified value when setting this property is not a [DataGridViewColumnHeaderCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumnheadercell) and this [DataGridViewBand](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewband) instance is of type [DataGridViewColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn).

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the relative position of the band within the [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) control.

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

[DataGridViewCellStyle](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle): Returns the cell style in effect for the current band, taking into account style inheritance.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns true when the implementation class is DataGridViewRow.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the user can edit the band's cells. (Default: `False`)

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

[DataGridViewTriState](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtristate): Returns or sets whether the band can be resized in the user interface (UI).

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the band is in a selected user interface (UI) state.

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

[Object](https://docs.microsoft.com/dotnet/api/system.object): Returns or sets the object that contains data to associate with the band.

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

[Object](https://docs.microsoft.com/dotnet/api/system.object): Returns a dynamic object that can be used to store custom data in relation to this band.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the band is visible to the user. (Default: `True`)

**Throws:**

* [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception)\
  The specified value when setting this property is false and the band is the row for new records.

## Methods

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

Creates an exact copy of this band.

**Returns:** [Object](https://docs.microsoft.com/dotnet/api/system.object). An [Object](https://docs.microsoft.com/dotnet/api/system.object) that represents the cloned [DataGridViewBand](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewband).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) Dispose(disposing)

Releases the resources used by the [DataGridViewBand](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewband).

| Parameter     | Type                                                            | Description                                                                 |
| ------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true when this method is called by the application rather than a finalizer. |

## Inherited By

| Name                                                                                                                                             | Description                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DataGridViewButtonColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncolumn)                 | Represents a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewButtonCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewbuttoncell) cells.                 |
| [DataGridViewCheckBoxColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcheckboxcolumn)             | Represents a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewCheckBoxCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcheckboxcell) cells.             |
| [DataGridViewColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn)                             | Represents a column in a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) control.                                                                                                                                                                     |
| [DataGridViewComboBoxColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcomboboxcolumn)             | Represents a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewComboBoxCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcomboboxcell) cells.             |
| [DataGridViewDateTimePickerColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdatetimepickercolumn) | Represents a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewDateTimePickerCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdatetimepickercell) cells. |
| [DataGridViewImageColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewimagecolumn)                   | Represents a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewImageCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewimagecell) cells.                   |
| [DataGridViewLinkColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewlinkcolumn)                     | Represents a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewLinkCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewlinkcell) cells.                     |
| [DataGridViewMaskedTextBoxColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewmaskedtextboxcolumn)   | Represents a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewTextBoxCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell) cells.               |
| [DataGridViewNumericUpDownColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewnumericupdowncolumn)   | Represents a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewNumericUpDownCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewnumericupdowncell) cells.   |
| [DataGridViewTextBoxColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcolumn)               | Represents a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) column that contains a collection of [DataGridViewTextBoxCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell) cells.               |
| [DataGridViewRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow)                                   | Represents a row in a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) control.                                                                                                                                                                        |
| [DataGridViewSummaryRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewsummaryrow)                     | Represents a summary row in a [DataGridView](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview) control.                                                                                                                                                                |

## Implements

| Name                                                                             | Description                                                                                                     |
| -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [IUserData](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.iuserdata) | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. |
