Back to Devexpress

GridBand.ParentBand Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-bandedgrid-dot-gridband-a3509f00.md

latest2.8 KB
Original Source

GridBand.ParentBand Property

Gets the parent band.

Namespace : DevExpress.XtraGrid.Views.BandedGrid

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
public virtual GridBand ParentBand { get; }
vb
<Browsable(False)>
Public Overridable ReadOnly Property ParentBand As GridBand

Property Value

TypeDescription
GridBand

A GridBand object representing the band’s parent. null ( Nothing in Visual Basic) if the band is at the root hierarchy level or if it not within the View’s bands hierarchy.

|

Remarks

To display a band within a view, you need to add the band to the View’s bands hierarchy. This can be done using methods provided by GridBandCollection objects representing band collections. The root band’s collection can be obtained using the View’s BandedGridView.Bands property. A band’s child band collection is returned by the band’s GridBand.Children property. If a band has been added to the root collection, its ParentBand property is set to null ( Nothing in Visual Basic). Otherwise, the property is set to the band whose child band collection contains the current band.

If you need to change a band’s parent, you need to add the band to the desired target band’s collection. The band will be removed from its current collection and its ParentBand property value will be updated.

See Also

HasChildren

RootBand

Children

BandLevel

GridBand Class

GridBand Members

DevExpress.XtraGrid.Views.BandedGrid Namespace