Skip to main content

ASPxGridView.AllColumns Property

Gets the collection of all columns within the ASPxGridView control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web


public ReadOnlyGridColumnCollection<GridViewColumn> AllColumns { get; }

Property Value

Type Description

A collection of all the columns in an ASPxGridView.


The AllColumns property provides access to a collection that contains all the columns of the ASPxGridView control (this includes columns of all the bands, if a banded layout is used). This collection is read-only, since individual columns can be manipulated (added or removed) at the level of a grid control (ASPxGridView.Columns) or a band column (GridViewColumn.Columns). The collection obtained via the AllColumns property allows you to easily iterate through all the grid columns and access any required column identified by its specific setting or type.


This sample demonstrates how the AllColumns method can be used to centrally define a display format for all date columns within a ASPxGridView control.

using DevExpress.Web.ASPxGridView;
    public void ChangeDateColumnDisplayFormat() { 
        foreach(GridViewColumn column in Grid.AllColumns) {
            GridViewDataDateColumn dateColumn = column as GridViewDataDateColumn;
            if(dateColumn != null)
               dateColumn.PropertiesDateEdit.DisplayFormatString = "d MMM yyyy";
See Also