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

GridColumnCollection Class

Represents a column collection in Grid Views and Card Views.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v18.1.dll

Declaration

[ListBindable(false)]
public class GridColumnCollection :
    CollectionBase,
    IEnumerable<GridColumn>,
    IEnumerable

The following members accept/return GridColumnCollection objects:

Remarks

Grid Views and Card Views store their columns in the ColumnView.Columns collection. This collection is represented by the GridColumnCollection class. Members of this class can be used to add, delete, access individual column objects and perform other common collection management tasks. Individual columns stored within such collections are represented by GridColumn objects. Note that you don’t have to create such objects manually. They are automatically created by the collection’s GridColumnCollection.Add and GridColumnCollection.Insert methods. You can also fill the collection with columns created for each data field within the View’s associated data source. Use the View’s ColumnView.PopulateColumns method for this purpose.

Since columns are used to represent data fields within Views, the GridColumnCollection class provides methods to obtain a particular column by its bound field name. This can be done using the collection’s indexer or via the GridColumnCollection.ColumnByFieldName method call.

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

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