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

GridViewColumn.Columns Property

Provides access to a collection of columns that the current column combines.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

NuGet Package: DevExpress.Web

Declaration

public GridViewColumnCollection Columns { get; }

Property Value

Type Description
GridViewColumnCollection

An GridViewColumnCollection object that is a collection of columns grouped by the current column.

Remarks

The Columns property stores a collection of GridViewColumn objects. This allows you to create data cell bands. The obtained column collection provides methods that allow you to add new and remove existing columns. Individual columns can be accessed using indexed notation.

Concept

Data Cell Bands

Example

Declaratively:

<dx:ASPxGridView ID="Grid" runat="server" ...>
    <Columns>
        <dx:GridViewDataColumn FieldName="Address">
            <Columns>
                <dx:GridViewDataColumn FieldName="Features">
                    <Columns>
                        <dx:GridViewDataColumn FieldName="Beds" />
                        ...
                    </Columns>
                </dx:GridViewDataColumn>
                ...
            </Columns>
        </dx:GridViewDataColumn>
    </Columns>
</dx:ASPxGridView>

In code:

ASPxGridView grid1 = new ASPxGridView();
grid1.ID = "grid1";
Page.Form.Controls.Add(grid1);
...
GridViewDataColumn address = new GridViewDataColumn();
address.FieldName = "Address";

GridViewDataColumn features = new GridViewDataColumn();
features.FieldName = "Features";        

GridViewDataColumn beds = new GridViewDataColumn();
beds.FieldName = "Beds";

address.Columns.Add(features);
features.Columns.Add(beds);

Online Example

ASPxGridView - How to create header and data cell bands

Online Demo

ASPxGridView - Data Cell Bands

Online Video

ASPxGridView - Data Cell Bands

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Columns property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also