Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataGridViewBand Class

Represents a linear collection of elements in a DataGridView control.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
type DataGridViewBand =  
        inherit DataGridViewElement 
        interface ICloneable 
        interface IDisposable 

The DataGridViewBand type exposes the following members.

Public propertyContextMenuStripGets or sets the shortcut menu for the band.
Public propertyDataGridViewGets the DataGridView control associated with this element. (Inherited from DataGridViewElement.)
Public propertyDefaultCellStyleGets or sets the default cell style of the band.
Public propertyDefaultHeaderCellTypeGets or sets the run-time type of the default header cell.
Public propertyDisplayedGets a value indicating whether the band is currently displayed onscreen.
Public propertyFrozenGets or sets a value indicating whether the band will move when a user scrolls through the DataGridView.
Public propertyHasDefaultCellStyleGets a value indicating whether the DefaultCellStyle property has been set.
Protected propertyHeaderCellCoreGets or sets the header cell of the DataGridViewBand.
Public propertyIndexGets the relative position of the band within the DataGridView control.
Public propertyInheritedStyleGets the cell style in effect for the current band, taking into account style inheritance.
Protected propertyIsRowGets a value indicating whether the band represents a row.
Public propertyReadOnlyGets or sets a value indicating whether the user can edit the band's cells.
Public propertyResizableGets or sets a value indicating whether the band can be resized in the user interface (UI).
Public propertySelectedGets or sets a value indicating whether the band is in a selected user interface (UI) state.
Public propertyStateGets the user interface (UI) state of the element. (Inherited from DataGridViewElement.)
Public propertyTagGets or sets the object that contains data to associate with the band.
Public propertyVisibleGets or sets a value indicating whether the band is visible to the user.
Public methodCloneCreates an exact copy of this band.
Public methodDispose()Releases all resources used by the DataGridViewBand.
Protected methodDispose(Boolean)Releases the unmanaged resources used by the DataGridViewBand and optionally releases the managed resources.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeReleases the resources associated with the band. (Overrides Object.Finalize().)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnDataGridViewChangedCalled when the band is associated with a different DataGridView. (Overrides DataGridViewElement.OnDataGridViewChanged().)
Protected methodRaiseCellClickRaises the DataGridView.CellClick event. (Inherited from DataGridViewElement.)
Protected methodRaiseCellContentClickRaises the DataGridView.CellContentClick event. (Inherited from DataGridViewElement.)
Protected methodRaiseCellContentDoubleClickRaises the DataGridView.CellContentDoubleClick event. (Inherited from DataGridViewElement.)
Protected methodRaiseCellValueChangedRaises the DataGridView.CellValueChanged event. (Inherited from DataGridViewElement.)
Protected methodRaiseDataErrorRaises the DataGridView.DataError event. (Inherited from DataGridViewElement.)
Protected methodRaiseMouseWheelRaises the Control.MouseWheel event. (Inherited from DataGridViewElement.)
Public methodToStringReturns a string that represents the current band. (Overrides Object.ToString().)

The DataGridViewBand class represents DataGridViewCell elements joined together in a band that can be manipulated as a group. Each element is typically an instance of DataGridViewCell or one of its derived classes. Although a DataGridViewHeaderCell is associated with each band, header cells are not considered elements of the band.

DataGridViewBand is the base class of the DataGridViewRow and DataGridViewColumn classes. There are no public constructors for the DataGridViewBand type, so the only way to access a band is through columns and rows in a DataGridView.

The following code example uses a DataGridViewBand to manipulate properties of groups of cells in a DataGridView.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.