Class DataItem
Inherited Members
Namespace: Telerik.Reporting
Assembly: Telerik.Reporting.dll
Syntax
public abstract class DataItem : ReportItem, IReportItem, IComponent, IDisposable, IToggleVisibilityTarget, IActionTarget, IDesignTimeStyleEditable, IDesignTimeSelectable, IDataItem, IDataFlow, IDataSourceContainer, INamedObject, ISupportsNeedDataSource, INoDataObject
Constructors
DataItem()
Declaration
public DataItem()
Properties
DataSource
Declaration
public object DataSource { get; set; }
Property Value
System. An object that functions as a data source. |
Implements
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 Data
Filters
Gets a
Filter
Declaration
public FilterCollection Filters { get; }
Property Value
Filter Filter |
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
public string NeedDataSourceMethodName { get; set; }
Property Value
System. A string value identifying the name of the method from the source assembly. |
NoDataMessage
Declaration
public string NoDataMessage { get; set; }
Property Value
System.
|
NoDataStyle
Sorting
Declaration
[Obsolete("Please use Sortings property instead.")]
public SortingCollection Sorting { get; }
Property Value
Sortings
Gets a
Sorting
Declaration
public SortingCollection Sortings { get; }
Property Value
Sorting A Sorting |
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)
Declaration
protected virtual void OnNeedDataSource(object sender, EventArgs e)
Parameters
System.
|
System.
|
Events
NeedDataSource
Occurs when the processing of the data item processing instance (i.e., Data
Declaration
public event EventHandler NeedDataSource
Event Type
System.
|
Remarks
The event is hooked on the definition Data
Examples
The following example demonstrates how to implement a NeedDataSource event handler:
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" };
}
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
Explicit Interface Implementations
IDataFlow.Filters
Declaration
IList<Filter> IDataFlow.Filters { get; }
Returns
System.
|
Implements
IDataFlow.Sortings
Declaration
IList<Sorting> IDataFlow.Sortings { get; }
Returns
System.
|