Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridControl.Views Property

Gets the collection of Views currently displayed by the grid control.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v24.2.dll

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

#Declaration

[Browsable(false)]
public GridControlViewCollection Views { get; }

#Property Value

Type Description
GridControlViewCollection

A GridControlViewCollection object containing Views that are currently displayed by the grid control.

#Remarks

The Views collection always contains the View specified by the GridControl.MainView property as its first element. Detail clones are added to the collection when they become visible (when created). When a master row is collapsed, all details created for it are destroyed. Thus, the corresponding elements are removed from the collection.

When an element is added to the Views collection, the GridControl.ViewRegistered event is raised. Removing an element from the collection raises the GridControl.ViewRemoved event. Note that you cannot add or remove Views manually. The collection returned by the Views property is read-only.

Note

Pattern Views residing within the GridControl.LevelTree tree are not included into the Views collection. These Views can be accessed via the GridControl.ViewCollection collection.

Please refer to the Master-Detail Relationships topic for additional information.

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