Skip to main content

GridBand.ParentBand Property

Gets the parent band.

Namespace: DevExpress.XtraGrid.Views.BandedGrid

Assembly: DevExpress.XtraGrid.v23.2.dll

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

Declaration

[Browsable(false)]
public virtual GridBand ParentBand { get; }

Property Value

Type Description
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