Class ObjectDataSource
Represents a data source component retrieving data from business objects.
Inherited Members
Namespace: Telerik.Reporting
Assembly: Telerik.Reporting.dll
Syntax
public class ObjectDataSource : ObjectDataSourceBase, INamedObject, ICloneable, IEquatableDataSource, IObjectDataSource, ISimpleDataSource, IDataSource
Constructors
ObjectDataSource()
ObjectDataSource(Object, String)
Initializes a new instance of the ObjectDataSource class.
Declaration
public ObjectDataSource(object dataSource, string dataMember)
Parameters
System.Object
dataSource
Specifies the data source object that is used to connect to data. |
System.String
dataMember
Specifies the data source member that is used to connect to data. |
Properties
DataMember
Gets or sets the data source member that is used to connect to data.
Declaration
public string DataMember { get; set; }
Property Value
System.String
|
Remarks
When the DataSource is a business object instance or type, the DataMember property determines the property or method of the business object to be invoked during data retrieval. If the DataSource property contains the System.Type of a business object, and the DataMember property is not set or is set to an empty string, the constructor with the specified parameters is invoked to create a new instance of the business object.
If the DataSource is an IListSource object with more than one table,
the DataMember property specifies the table to bind to.
For example, if the DataSource is a
DataSet or DataViewManager that contains three tables
named Customers
, Orders
, and
OrderDetails
, the DataMember should contain the name of one of these tables.
DataSource
Gets or sets the data source object that is used to connect to data.
Declaration
public object DataSource { get; set; }
Property Value
System.Object
|
Remarks
The DataSource property can handle various built-in .NET types and types implementing various interfaces representing rows of data. Either an object instance of these types or a System.Type object from which the report engine will create an instance at runtime can be assigned to this property. Note that some of the supported data objects also require setting up the DataMember property.
More details and the full list of supported object types is available at https://docs.telerik.com/reporting/designing-reports/connecting-to-data/data-source-components/objectdatasource-component/overview.