Skip to main content

TableRowProcessorDelegate Delegate

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

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

[ComVisible(true)]
public delegate void TableRowProcessorDelegate(
    TableRow row,
    int rowIndex
);

Parameters

Name Type Description
row TableRow

A TableRow object that is the row for which the delegate is executed.

rowIndex Int32

An integer that is the index of a row in a table.

Remarks

Use the Table.ForEachRow method to employ the TableRowProcessorDelegate instance.

Tip

You can also use anonymous methods as delegates.

Example

The following code snippet paints the third column with a light cyan color.

View Example

Table table = document.Tables.Create(document.Range.Start, 3, 10);
table.BeginUpdate();

// Change cell background color and vertical alignment in the third column.
table.ForEachRow(new TableRowProcessorDelegate(ChangeColumnAppearanceHelper.ChangeColumnColor));
table.EndUpdate();

class ChangeColumnAppearanceHelper
{
    public static void ChangeColumnColor(TableRow row, int rowIndex)
    {
        row[2].BackgroundColor = System.Drawing.Color.LightCyan;
        row[2].VerticalAlignment = TableCellVerticalAlignment.Center;
    }
}
See Also