Progress® Telerik® Reporting R3 2017

TableRowGetCell Method

Gets an ITableCell at the specified column index.

Namespace:  Telerik.Reporting.Processing
Assembly:  Telerik.Reporting (in Telerik.Reporting.dll)

Syntax

public ITableCell GetCell(
	int columnIndex
)

Parameters

columnIndex
Type: SystemInt32

Return Value

Type: ITableCell
An ITableCell instance.

Remarks

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

Examples

The following code snippet demonstrates a sample usage of the GetCell method:
var tableDef = new Telerik.Reporting.Table();

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

    foreach (Telerik.Reporting.Processing.TableRow row in table.Rows)
    {
        for (int colIndex = 0; colIndex < table.Rows.Count; colIndex++)
        {
            Telerik.Reporting.Processing.ITableCell cell = row.GetCell(colIndex);

            if (cell.RowIndex == row.Index 
                && cell.ColumnIndex == colIndex)
            {
                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.
            }
        }
    }
};

See Also