Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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