Skip to main content

ColumnView.Columns Property

Provides access to the collection of columns available for display within the View.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation


[XtraSerializableProperty(XtraSerializationVisibility.Collection, true, true, true, 0, XtraSerializationFlags.DefaultValue)]
public virtual GridColumnCollection Columns { get; }

Property Value

Type Description

A GridColumnCollection object representing a collection of available columns within the current View.


Use the Columns property to access the collection of columns in the View. You can add, move, and delete columns. You can also access individual columns using indexer notation or by the bound field name.

using DevExpress.XtraGrid.Columns;

// Gets the first column in the Columns collection.
GridColumn colFirst = gridView1.Columns[0];
// Gets the column by its bound field name.
GridColumn colFirstName = gridView1.Columns["FirstName"];
// Adds a new column to the Columns collection.
gridView1.Columns.Add(new GridColumn() {
    Caption = "Last Name",
    FieldName = "LastName",
    Visible = true

In the CardView and LayoutView, columns are displayed as card fields. In the WinExplorerView, columns correspond to list item fields.

Column Types

View Type

Column Type










Read the following topic for detailed information and examples: Grid Columns.


To display columns from the Columns collection in the WinExplorerView, assign them to the predefined WinExplorerView columns from ColumnSet.

Read the following topic for detailed information: WinExplorer View


The following example demonstrates how to create a column within a View, and assign a specific editor to it.

    using DevExpress.XtraGrid.Views.BandedGrid;
    using DevExpress.XtraEditors.Repository;
    // Create a column
    BandedGridColumn col = advBandedGridView1.Columns.Add("Country") as BandedGridColumn;
    // Add a column to the first Band
    // Show the new column
    col.Visible = true;
    // Create a Repository Item
    RepositoryItemLookUpEdit columnEditor = new RepositoryItemLookUpEdit();
    // Customize the editor
    // Add the new Repository Item to the "RepositoryItems" collection
    // Assign the editor to the new column
    col.ColumnEdit = columnEditor;

The following code snippets (auto-collected from DevExpress Examples) contain references to the Columns property.


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