Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Collapse]Grid View
    Overview - GridView
    Main Features - GridView
   [Collapse]Concepts
    [Expand]Binding to Data
    [Collapse]Data Representation Basics
     [Expand]Cells
     [Collapse]Columns
       Data Columns
       Command Column
       Band Columns
       Unbound Columns
       Fixed Columns
     [Expand]Rows
      Customization Window
    [Expand]Focus and Navigation
    [Expand]Data Editing and Validation
    [Expand]Export Overview
   [Expand]Visual Elements
   [Expand]Examples
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]HTML Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Navigation and Layout Extensions
  [Expand]File Management
  [Expand]Multi-Use Site Extensions
  [Expand]Charts
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Tree List
  [Expand]Data Editor Extensions
  [Expand]Report Extensions
  [Expand]SpellChecker
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Band Columns

The ASP.NET MVC GridView provides the ability to organize columns in logical groups (bands) and display them using multi-row header representation. A band is visually represented by a header displayed above the headers of the columns it combines.

Expanded Band Column Type

Each band is implemented as a specific column type - MVCxGridViewBandColumn.

A band column is a different kind of column - it is not designed to display data values directly (it does not support data operations such as sorting, grouping, etc.), but to contain other columns as children within its MVCxGridViewBandColumn.Columns collection. It is possible to have a hierarchy of nested bands by placing another band column into a band column's MVCxGridViewBandColumn.Columns collection. Note that you can store a data column and a band column at the same hierarchy level (i.e., within the same Columns collection).

The code sample below demonstrates how to create a banded layout.

Expanded Accessing Columns in a Banded Layout

Defining bands within a GridView implies having a hierarchical column structure. In this case, the GridView's GridViewSettings.Columns property only provides access to root level columns. To make it easier to traverse through all columns, GridView introduces a specific ASPxGridView.AllColumns (via MVCxGridView.AllColumns) property. It provides access to a read-only collection containing all grid columns.

Expanded End-User Manipulations

Bands are not only used for display purposes. They can be dragged by end-users to re-order columns or hide a group of columns within the grid's customization window. This is extremely useful if you need to provide a quick way to re-arrange or hide columns while preserving their logical grouping. Note that columns (and bands) are only allowed to be moved 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 with bands. Note that you can only apply column freezing (controlled by the GridViewColumn.FixedStyle (via the MVCxGridViewColumn.FixedStyle) property to columns and bands located at the root hierarchy level (i.e., within the grid's GridViewSettings.Columns collection).

How would you rate this topic?​​​​​​​