BaseView.DataSource Property
Gets the data source whose data is displayed by a View.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
Declaration
Property Value
Type | Description |
---|---|
Object | A data source object whose data is displayed by the current View. |
Remarks
This property returns the data source which contains data displayed by the current View. For the GridControl.MainView, the property returns the data source specified by the GridControl.DataSource and GridControl.DataMember properties. If these properties refer to a specific DataTable object, the current property will return the DataView object created for this DataTable. If you populate the grid by binding it to an object implementing the IList interface, the DataSource property will return this IList.
If the current View represents a detail clone view, the DataSource property will return the data source containing data only for this clone. For detail pattern Views, the DataSource property returns null. Refer to the Master-Detail Relationships topic for more information on clone and pattern Views.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DataSource 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.