Skip to main content

Fixed Columns and Bands

  • 2 minutes to read

The TableView allows you to anchor (fix) columns and bands to the left or right edge, so they are not horizontally scrolled with the View. This can be useful when columns (bands) should always be displayed onscreen, regardless of scrolling.

Run Demo: Fixed Data Columns

To fix a column or a band, use its BaseColumn.Fixed property. This property is initially set to FixedStyle.None and the column/band is not fixed. Set the BaseColumn.Fixed property to FixedStyle.Left or FixedStyle.Right to fix the column/band to the left or right View edge, respectively.

Fixed columns and bands are separated from other columns and bands by a vertical line. Its width is specified by the TableView.FixedLineWidth property.

If the GridControl contains fixed columns, its horizontal scrollbar fills only the scrollable part (the width of non-fixed columns). Set the TableView.ExtendScrollBarToFixedColumns property to true to extend the scrollbar width to fixed columns.

The animation below shows the Table View with one column fixed to the left and one column fixed to the right.

FixedColumnsAnimation

The TableView includes the following properties that allow you to obtain fixed and non-fixed columns:

You can allow users to fix columns and bands within the GridControl. Set the TableView.AllowFixedColumnMenu / TreeListView.AllowFixedColumnMenu property to true to display the Fixed Style option in the column header’s context menu:

Fixed Style Example

Usage Notes

  • Use Fixed Columns and Bands when the automatic column width calculation feature is disabled and the total width of columns/bands exceeds the view’s width. Otherwise, horizontal scrolling is disabled.
  • You cannot fix a column within a band. Only the entire band can be fixed.