Class
ObjectDataSource

Represents a data source component retrieving data from business objects.

Definition

Namespace:Telerik.Reporting

Assembly:Telerik.Reporting.dll

Syntax:

cs-api-definition
public class ObjectDataSource : ObjectDataSourceBase, IDataSource

Inheritance: objectMarshalByRefObjectComponentDataSourceObjectDataSourceBaseObjectDataSource

Implements: IDataSource

Inherited Members ObjectDataSourceBase.ParametersDataSource.NameDataSource.DescriptionDataSource.CalculatedFields

Constructors

ObjectDataSource()

Initializes a new instance of the ObjectDataSource class.

Declaration

cs-api-definition
public ObjectDataSource()

ObjectDataSource(object, string)

Initializes a new instance of the ObjectDataSource class.

Declaration

cs-api-definition
public ObjectDataSource(object dataSource, string dataMember)

Parameters

dataSource

object

Specifies the data source object that is used to connect to data.

dataMember

string

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

cs-api-definition
public string DataMember { get; set; }

Property Value

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 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

cs-api-definition
[TypeConverter(typeof(ObjectDataSourceTypeConverter))]
public object DataSource { get; set; }

Property Value

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 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.