Skip to main content
A newer version of this page is available. .

Hiding and Displaying Columns and Bands

  • 2 minutes to read

Columns and card fields are represented by GridColumn objects. Bands are represented by GridControlBand and TreeListControlBand objects. To hide a column or a band, set its BaseColumn.Visible property to false. If a column’s ColumnBase.ShowInColumnChooser option is enabled, when the column is hidden its header is displayed in the Column Band Chooser.

To show a hidden column or band, set its BaseColumn.Visible property to true. To show it at a specified position among visible columns and bands, use its BaseColumn.VisibleIndex property.

End-User Capabilities

An end-user can temporarily hide columns and bands by dragging their headers to the Column Band Chooser. The Column/Band Chooser can be shown via a column header’s popup menu. Dragging a header from the Column Chooser to the header panel shows the column or band within a view.

To allow an end-user to hide columns and bands, the following options must be enabled.

If the DataViewBase.AllowMoveColumnToDropArea property is set to true, an end-user can hide a column or a band by dropping its header outside the View.

Accessing Visible and Hidden Columns

The grid stores its columns (visible and hidden) in the GridControl.Columns collection. Individual columns and bands can be accessed by name or indexed notation.

To only access visible columns (whose BaseColumn.Visible property is set to true), use the GridViewBase.VisibleColumns property of the view. This property returns a list containing GridColumn objects that correspond to columns displayed within the view.

Hidden columns that are displayed within the Column/Band Chooser are stored within the view’s DataViewBase.ColumnChooserColumns read-only collection.

Individual columns can be accessed using indexed notation.

Overlaying Band Header

When the BandBase.OverlayHeaderByChildren property is set to true, the band’s children (child bands and columns) hide the band’s header and occupy its space.

WPF_Grid_Band_OverlayHeaderByChildren

Note

When the band’s BandBase.OverlayHeaderByChildren property is set to true, and the band has no children, the band’s header will be displayed.