Class
Table

Represents a processing Table item.

Definition

Namespace:Telerik.Reporting.Processing

Assembly:Telerik.Reporting.dll

Syntax:

cs-api-definition
public class Table : DataItem, ITableCell, IDataItem, IDataFlow, IDataSourceContainer, ILayoutElementContainer

Inheritance: objectReportObjectLayoutElementVisualElementProcessingElementReportItemBaseReportItemNoDataObjectDataItemTable

Implements: IDataFlowIDataItemIDataSourceContainerILayoutElementContainerITableCell

Inherited Members DataItem.DataSourceDataItem.NeedDataSourceMethodNameDataItem.RenderNoDataDataItem.VisibleNoDataObject.NoDataMessageNoDataObject.NoDataStyleReportItem.BoundsReportItem.LocationReportItem.SizeReportItem.TopReportItem.LeftReportItem.WidthReportItem.HeightReportItem.DockingReportItem.AnchoringReportItemBase.InitializeDefinitionBasedProperties(ReportObject)ReportItemBase.TryExecuteMethodByName(string)ReportItemBase.ProcessAccessibleRole()ReportItemBase.ProcessAccessibleDescription()ReportItemBase.ProcessAIDescription()ReportItemBase.BookmarkReportItemBase.BookmarkIdReportItemBase.DocumentMapTextReportItemBase.TocTextReportItemBase.ActionReportItemBase.ItemDataBindingMethodNameReportItemBase.ItemDataBoundMethodNameReportItemBase.ItemDefinitionReportItemBase.NameReportItemBase.AccessibleDescriptionReportItemBase.AccessibleRoleReportItemBase.AIDescriptionProcessingElement.OnError(Exception)ProcessingElement.ConvertBoundValue(PropertyInfo, object)ProcessingElement.ToString()ProcessingElement.ExceptionProcessingElement.ParentProcessingElement.ReportProcessingElement.CultureProcessingElement.ChildElementsProcessingElement.DataObjectProcessingElement.ThrowWhenBindingUnsuccessfulVisualElement.StyleLayoutElement.ParentElementReportObject.ToString(string[])

Properties

Columns

Gets a list of TableColumn objects that represents the columns in a Table item.

Declaration

cs-api-definition
public IList<TableColumn> Columns { get; }

Property Value

IList<TableColumn>

KeepTogether

Internal use only

Declaration

cs-api-definition
public bool KeepTogether { get; }

Property Value

bool

Rows

Gets a list of TableRow objects that represents the rows in a Table item.

Declaration

cs-api-definition
public IList<TableRow> Rows { get; }

Property Value

IList<TableRow>

Methods

Dispose(bool)

Internal use only

Declaration

cs-api-definition
protected override void Dispose(bool disposing)

Parameters

disposing

bool

Overrides ReportItemBase.Dispose(bool)

GetCell(int, int)

Gets an ITableCell at the specified row and column index.

Declaration

cs-api-definition
public ITableCell GetCell(int rowIndex, int columnIndex)

Parameters

rowIndex

int

columnIndex

int

Returns

ITableCell

ITableCell.

Remarks

This method should be used after the Table item is data bound.

Example

The following code snippet demonstrates a sample usage of the GetCell method:.

cs
var tableDef = new Telerik.Reporting.Table();

tableDef.ItemDataBound += delegate(object sender, EventArgs args)
{
    Telerik.Reporting.Processing.Table table = (Telerik.Reporting.Processing.Table)sender;

    for (int rowIndex = 0; rowIndex < table.Rows.Count; rowIndex++)
    {
        for (int columnIndex = 0; columnIndex < table.Columns.Count; columnIndex++)
        {
            Telerik.Reporting.Processing.ITableCell cell = table.GetCell(rowIndex, columnIndex);

            if (cell.RowIndex == rowIndex 
                && cell.ColumnIndex == columnIndex)
            {
                Telerik.Reporting.Processing.ReportItem item = cell.Item; 

                // Here you can do something with the report item
            }
            else
            {
                // Do nothing. This is part of a merged table cell.
            }
        }
    }
};
vb
Private Sub TableDef_ItemDataBound1(ByVal sender As Object, ByVal e As EventArgs) Handles tableDef.ItemDataBound
    Dim table As Telerik.Reporting.Processing.Table = DirectCast(sender, Telerik.Reporting.Processing.Table)

    For rowIndex = 0 To table.Rows.Count - 1
        For columnIndex = 0 To table.Columns.Count - 1
            Dim cell = table.GetCell(rowIndex, columnIndex)

            If cell.RowIndex = rowIndex AndAlso cell.ColumnIndex = columnIndex Then
                Dim item As Telerik.Reporting.Processing.ReportItem = cell.Item

                ' Here you can do something with the report item

            Else

                ' Do nothing. This is part of a merged table cell

            End If
        Next
    Next
End Sub