skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Use Reports in Applications
    • System Requirements
    • Forums
    • Videos
    • Blogs
    • Submit a Ticket
    • FAQs
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now
Search all

Class DataItem

Inheritance
System.Object
ReportObject
ReportItemBase
ReportItem
DataItem
Chart
Graph
LinearGauge
Map
RadialGauge
Table
Inherited Members
ReportItem.Size
ReportItem.Location
ReportItem.Anchoring
ReportItem.Anchor
ReportItem.Docking
ReportItem.Dock
ReportItem.Bounds
ReportItem.Left
ReportItem.Right
ReportItem.Top
ReportItem.Bottom
ReportItem.Width
ReportItem.Height
ReportItem.DefaultSize
ReportItemBase.Dispose()
ReportItemBase.Dispose(Boolean)
ReportItemBase.ToString()
ReportItemBase.Contains(ReportItemBase)
ReportItemBase.GetEventHandlers(EventHandler)
ReportItemBase.OnItemValidate(ReportItemBase)
ReportItemBase.ClearGlobalDependencies()
ReportItemBase.Container
ReportItemBase.DesignMode
ReportItemBase.Site
ReportItemBase.Name
ReportItemBase.ItemDataBindingMethodName
ReportItemBase.ItemDataBoundMethodName
ReportItemBase.Visible
ReportItemBase.StyleName
ReportItemBase.Style
ReportItemBase.Items
ReportItemBase.Parent
ReportItemBase.Report
ReportItemBase.ConditionalFormatting
ReportItemBase.Bookmark
ReportItemBase.BookmarkId
ReportItemBase.DocumentMapText
ReportItemBase.TocText
ReportItemBase.Action
ReportItemBase.Bindings
ReportItemBase.ToolTip
ReportItemBase.AccessibleDescription
ReportItemBase.AccessibleRole
ReportItemBase.AIDescription
ReportItemBase.ItemDataBinding
ReportItemBase.ItemDataBound
ReportItemBase.Disposed
ReportObject.ToString(String[])
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

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

Declaration
public object DataSource { get; set; }
Property Value
System.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
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
public string NeedDataSourceMethodName { get; set; }
Property Value
System.String

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

NoDataMessage

Declaration
public string NoDataMessage { get; set; }
Property Value
System.String

NoDataStyle

Declaration
public Style NoDataStyle { get; }
Property Value
Style

Sorting

Declaration
[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
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)

Declaration
protected virtual void OnNeedDataSource(object sender, EventArgs e)
Parameters
System.Object sender

System.EventArgs e

Events

NeedDataSource

Occurs when the processing of the data item processing instance (i.e., DataItem instance) begins and this instance has no DataSource property set.

Declaration
public event EventHandler NeedDataSource
Event Type
System.EventHandler

Remarks

The event is hooked on the definition DataItem instance, but the sender object in the event handler is the processing DataItem instance. The processing instance of the data item inherits its DataSource from the definition instance, but if neither has DataSource set, this event is raised.

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.Collections.Generic.IList<Filter>

Implements
IDataFlow.Filters

IDataFlow.Sortings

Declaration
IList<Sorting> IDataFlow.Sortings { get; }
Returns
System.Collections.Generic.IList<Sorting>

Implements
IDataFlow.Sortings
Getting Started
  • Install Now
  • Online Demos
Support Resources
  • Documentation
  • Knowledge Base
  • Videos
  • Reporting Samples Repository
  • Reporting Release History
Community
  • Forums
  • Blogs
  • Reporting Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.