Class
DataItem

Internal use only

Definition

Namespace:Telerik.Reporting

Assembly:Telerik.Reporting.dll

Syntax:

cs-api-definition
public abstract class DataItem : ReportItem, IToggleVisibilityTarget, IActionTarget, IDataItem, IDataFlow, IDataSourceContainer

Inheritance: objectReportObjectReportItemBaseReportItemDataItem

Derived Classes: GraphLinearGaugeMapRadialGaugeTable

Implements: IActionTargetIDataFlowIDataItemIDataSourceContainerIToggleVisibilityTarget

Inherited Members ReportItem.SizeReportItem.LocationReportItem.AnchoringReportItem.DockingReportItem.BoundsReportItem.LeftReportItem.RightReportItem.TopReportItem.BottomReportItem.WidthReportItem.HeightReportItem.DefaultSizeReportItemBase.Dispose()ReportItemBase.Dispose(bool)ReportItemBase.ToString()ReportItemBase.Contains(ReportItemBase)ReportItemBase.GetEventHandlers(EventHandler)ReportItemBase.OnItemValidate(ReportItemBase)ReportItemBase.ClearGlobalDependencies()ReportItemBase.ContainerReportItemBase.DesignModeReportItemBase.SiteReportItemBase.NameReportItemBase.ItemDataBindingMethodNameReportItemBase.ItemDataBoundMethodNameReportItemBase.VisibleReportItemBase.StyleNameReportItemBase.StyleReportItemBase.ItemsReportItemBase.ParentReportItemBase.ReportReportItemBase.ConditionalFormattingReportItemBase.BookmarkReportItemBase.BookmarkIdReportItemBase.DocumentMapTextReportItemBase.TocTextReportItemBase.ActionReportItemBase.BindingsReportItemBase.ToolTipReportItemBase.AccessibleDescriptionReportItemBase.AccessibleRoleReportItemBase.AIDescriptionReportItemBase.ItemDataBindingReportItemBase.ItemDataBoundReportItemBase.DisposedReportObject.ToString(string[])

Constructors

DataItem()

Internal use only

Declaration

cs-api-definition
public DataItem()

Properties

DataSource

Gets or sets the data source that the DataItem (e.g., Table, Graph, Map) is displaying data for.

Declaration

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

Property Value

object

An object that functions as a data source.

Implements IDataSourceContainer.DataSource

Remarks

Telerik Reporting includes dedicated data source components that enable retrieving and feeding all data items from various sources. See all the available data source components at: https://docs.telerik.com/reporting/designing-reports/connecting-to-data/data-source-components/overview

For convenience, all the objects applicable to the DataSource property can be directly assigned to this DataSource property. At runtime, the report engine will wrap them in an ObjectDataSource to resolve the actual data.

Filters

Gets a FilterCollection that defines the filter expression(s) for the Table

Declaration

cs-api-definition
public FilterCollection Filters { get; }

Property Value

FilterCollection

FilterCollection that contains the Filter objects for the Table

Remarks

Filter expressions limit the data that is displayed to the user after the data is retrieved from the data source.

NeedDataSourceMethodName

Gets or sets the name of the method that should be called when the NeedDataSource event is triggered.

Declaration

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

Property Value

string

A string value identifying the name of the method from the source assembly.

NoDataMessage

Internal use only

Declaration

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

Property Value

string

NoDataStyle

TODO: Add documentation.

Declaration

cs-api-definition
[TypeConverter(typeof(ExpandableObjectConverter))]
public Style NoDataStyle { get; }

Property Value

Style

Sorting

Internal use only

Declaration

cs-api-definition
[Browsable(false)]
[Obsolete("Please use Sortings property instead.")]
public SortingCollection Sorting { get; }

Property Value

SortingCollection

Sortings

Gets a SortingCollection that defines the sort column(s), and their type and order for the Table

Declaration

cs-api-definition
public SortingCollection Sortings { get; }

Property Value

SortingCollection

A SortingCollection that contains the Sorting objects for the Table

Remarks

Sort expressions sort the data that is displayed to the user after the data is retrieved from the data source.

Methods

OnNeedDataSource(object, EventArgs)

Internal use only

Declaration

cs-api-definition
protected virtual void OnNeedDataSource(object sender, EventArgs e)

Parameters

sender

object

e

EventArgs

Events

NeedDataSource

Occurs when the processing of a DataItem instance begins, and the instance does not have its DataSource property set.

Declaration

cs-api-definition
public event EventHandler NeedDataSource

Event Value

EventHandler

Remarks

This event is attached to the definition-level DataItem instance, but the sender in the event handler is the processing-level DataItem instance. The processing instance inherits its DataSource from the definition, and if neither has a DataSource set, this event is raised.

Example

The following example demonstrates how to implement a NeedDataSource event handler:

cs
void table1_NeedDataSource(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.DataItem processingDataItem = (Telerik.Reporting.Processing.DataItem)sender;
    Telerik.Reporting.Processing.Report processingReport = processingDataItem.Report;
    object processingParameterValue = processingReport.Parameters["parameter1"].Value;
    processingDataItem.DataSource = GetData(processingParameterValue);
}

static object GetData(object value)
{
    // Implement your custom data retrieval logic instead
    return new string[] { "Sofia", "London", "Tokyo" };
}
vb
Private Sub table1_NeedDataSource(sender As Object, e As EventArgs)
    Dim processingDataItem As Telerik.Reporting.Processing.DataItem = DirectCast(sender, Telerik.Reporting.Processing.DataItem)
    Dim processingReport As Telerik.Reporting.Processing.Report = processingDataItem.Report
    Dim processingParameterValue As Object = processingReport.Parameters("parameter1").Value
    processingDataItem.DataSource = GetData(processingParameterValue)
End Sub
Private Shared Function GetData(value As Object) As Object

    ' Implement your custom data retrieval logic instead

    Return New String() {"Sofia", "London", "Tokyo"}
End Function