Class TableColumn
Represents a column in the Table item.
Inheritance
System.Object
TableColumn
Namespace: Telerik.Reporting.Processing
Assembly: Telerik.Reporting.dll
Syntax
public sealed class TableColumn : IDisposable, ITableLine
Properties
Index
Declaration
public int Index { get; }
Property Value
System.Int32
|
Methods
Dispose()
Declaration
public void Dispose()
GetCell(Int32)
Gets an ITableCell at the specified row index.
Declaration
public ITableCell GetCell(int rowIndex)
Parameters
System.Int32
rowIndex
|
Returns
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.TableColumn column in table.Columns)
{
for (int rowIndex = 0; rowIndex < table.Rows.Count; rowIndex++)
{
Telerik.Reporting.Processing.ITableCell cell = column.GetCell(rowIndex);
if (cell.RowIndex == rowIndex
&& cell.ColumnIndex == column.Index)
{
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.
}
}
}
};
Private Sub TableDef_ItemDataBound2(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 Each column As Telerik.Reporting.Processing.TableColumn In table.Columns
For rowIndex As Integer = 0 To table.Rows.Count - 1
Dim cell As Telerik.Reporting.Processing.ITableCell = column.GetCell(rowIndex)
If cell.RowIndex = rowIndex AndAlso cell.ColumnIndex = column.Index 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
ToString()
Declaration
public override string ToString()
Returns
System.String
|
Overrides
System.Object.ToString()