Skip to main content

GridControl.ViewCollection Property

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

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v24.1.dll

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

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 snippet (auto-collected from DevExpress Examples) contains a reference 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