officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-26995493.md
A delegate intended to invoke its method for each row in a table.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
[ComVisible(true)]
public delegate void TableRowProcessorDelegate(
TableRow row,
int rowIndex
);
<ComVisible(True)>
Public Delegate Sub TableRowProcessorDelegate(
row As TableRow,
rowIndex As Integer
)
| 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.
|
Use the Table.ForEachRow method to employ the TableRowProcessorDelegate instance.
Tip
You can also use anonymous methods as delegates.
The following code snippet paints the third column with a light cyan color.
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;
}
}
Dim table As 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(AddressOf ChangeColumnAppearanceHelper.ChangeColumnColor))
table.EndUpdate()
Private Class ChangeColumnAppearanceHelper
Public Shared Sub ChangeColumnColor(ByVal row As TableRow, ByVal rowIndex As Integer)
row(2).BackgroundColor = System.Drawing.Color.LightCyan
row(2).VerticalAlignment = TableCellVerticalAlignment.Center
End Sub
End Class
See Also