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

GridControl.ViewCollection Property

Provides access to the collection of Views in the grid’s View repository.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v19.2.dll

Declaration

[Browsable(false)]
public ViewRepositoryCollection ViewCollection { get; }

Property Value

Type Description
DevExpress.XtraGrid.Repository.ViewRepositoryCollection

A DevExpress.XtraGrid.Repository.ViewRepositoryCollection object that represents the collection of Views within the grid’s View repository.

Remarks

The Views used to represent the data in the Grid Control should be added to a View repository represented by an object of the DevExpress.XtraGrid.Repository.ViewRepository class. When a View’s BaseView.GridControl property is initialized it is automatically added to the grid’s View repository. Views in this repository can be used as pattern Views or assigned to the GridControl.MainView property.

The ViewCollection property represents a collection of the Views within the grid’s View repository. To add a View to the grid’s View repository, add it to this collection.

The GridControl.Views collection allows you to access Views that are currently used in the grid control (displayed on-screen). It contains the View specified by the GridControl.MainView property and detail clone Views.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ViewCollection 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