New to Telerik ReportingStart a free 30-day trial

Represents a data source component retrieving data from business objects.

Definition

Namespace:Telerik.Reporting

Assembly:Telerik.Reporting.dll

Syntax:

C#
public class ObjectDataSource : ObjectDataSourceBase, IDataSource

Inheritance: objectMarshalByRefObjectComponentDataSourceObjectDataSourceBaseObjectDataSource...

Implements: IDataSource

Inherited Members ObjectDataSourceBase.ParametersDataSource.NameDataSource.DescriptionDataSource.CalculatedFields

Constructors

Initializes a new instance of the ObjectDataSource class.

C#
public ObjectDataSource()

Initializes a new instance of the ObjectDataSource class.

C#
public ObjectDataSource(object dataSource, string dataMember)
Parameters:dataSourceobject

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

dataMemberstring

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

Properties

Gets or sets the data source member that is used to connect to data.

C#
public string DataMember { get; set; }
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.

Gets or sets the data source object that is used to connect to data.

C#
[TypeConverter(typeof(ObjectDataSourceTypeConverter))]
public object DataSource { get; set; }
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.