The Grid View's multi-row headers feature allows you to organize grid columns in logical groups (bands). This demo illustrates basic band functionality.
A band is visually represented by a header displayed above headers of the columns it combines. Each band is realized as a specific column type - MVCxGridViewBandColumn. A band column is a different kind of column - it is designed not to display data values directly, but to contain other (child) columns within its Columns collection. Therefore, it is possible to have a hierarchy of nested bands. Moreover, you can place a data column and a band column at the same hierarchy level. To add a data column use a column collection's Add method to add a band column - the AddBand method.
Bands are not only used for display purposes. They can be dragged by end-users to re-order columns. This is extremely useful if you need to provide a quick way to re-arrange columns while preserving their logical grouping. Note that columns (and bands) are only allowed to move within their parent bands - you cannot move a child column from one parent band to another. This prevents end-users from breaking column grouping logic.
Resizing and column freezing features also work fine with bands. The only note is that column freezing (controlled by the FixedStyle property) can be applied only to columns and bands located at the root hierarchy level (i.e. within the grid's Columns collection).
See Also:
Local Copy of this Demo To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer. |
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxGridViewDemos |