Back to Devexpress

TableCellProcessorDelegate Delegate

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-1aa13f63.md

latest2.9 KB
Original Source

TableCellProcessorDelegate Delegate

A delegate intended to invoke its method for each cell in a table.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
[ComVisible(true)]
public delegate void TableCellProcessorDelegate(
    TableCell cell,
    int rowIndex,
    int cellIndex
);
vb
<ComVisible(True)>
Public Delegate Sub TableCellProcessorDelegate(
    cell As TableCell,
    rowIndex As Integer,
    cellIndex As Integer
)

Parameters

NameTypeDescription
cellTableCell

A TableCell object that is the cell for which the delegate is executed.

| | rowIndex | Int32 |

An integer that is the index of a row to which the cell belongs.

| | cellIndex | Int32 |

An integer that is the index of a column to which the cell belongs.

|

Remarks

Use the Table.ForEachCell method to employ the TableCellProcessorDelegate instance.

Tip

You can also use anonymous methods as delegates.

Example

csharp
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

void IterateCells(Table _table) {
    _table.BeginUpdate();
    _table.ForEachCell(new TableCellProcessorDelegate(MakeMultiplicationCell));
    _table.EndUpdate();
}

void MakeMultiplicationCell(TableCell cell, int i, int j)
{
    richEditControl1.Document.InsertText(cell.Range.Start,
        String.Format("{0}*{1} = {2}", i+2, j+2, (i+2) * (j+2)));
}
vb
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native

Private Sub IterateCells(ByVal _table As Table)
    _table.BeginUpdate()
    _table.ForEachCell(New TableCellProcessorDelegate(AddressOf MakeMultiplicationCell))
    _table.EndUpdate()
End Sub

Private Sub MakeMultiplicationCell(ByVal cell As TableCell, ByVal i As Integer, ByVal j As Integer)
    richEditControl1.Document.InsertText(cell.Range.Start, String.Format("{0}*{1} = {2}", i+2, j+2, (i+2) * (j+2)))
End Sub

See Also

DevExpress.XtraRichEdit.API.Native Namespace