ObjectDataSource.DataSource Property
Specifies the object data source that can be a specific object instance or a type.
Namespace: DevExpress.DataAccess.ObjectBinding
Assembly: DevExpress.DataAccess.v24.1.dll
NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap
Declaration
Property Value
Type | Description |
---|---|
Object | A Object value, specifying the data source. |
Remarks
Because the Data Source wizard cannot be used for binding to a specific object instance, it is required to assign this instance to the DataSource property in code before calling the ObjectDataSource.Fill method. In the wizard, this scenario corresponds to the “Retrieve the data source schema” option.
If the DataSource property has been assigned a type, the ObjectDataSource will try to create an instance of this type when calling the ObjectDataSource.Fill method (this will require specifying the ObjectDataSource.Parameters property). In the wizard, this scenario corresponds to the “Retrieve the actual data” option.
If the ObjectDataSource.DataMember property has been assigned a static member, creating an instance of the corresponding type is not required, nor is specifying the constructor parameters.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references 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.