XlsxExportOptionsEx.AfterAddRow Event

Fires immediately after a row is added to the output document.Only available in data-aware export mode.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v21.1.Core.dll


public event AfterAddRowEventHandler AfterAddRow


To learn more about the functionality provided by this event, see XlsExportOptionsEx.AfterAddRow.


The AfterAddRow event is not currently supported when exporting data from Advanced Banded Grid Views.


This example uses the XlsxExportOptionsEx.AfterAddRow event to merge cells in rows in an XLSX document (a result of data exporting from a Grid Control). Rows that correspond to the grid control’s group rows are merged using the ExportContext.MergeCells method.

For group rows, the DataSourceRowIndex event parameter returns negative values. The current row in the export output is specified by the DocumentRow parameter.


void options_AfterAddRow(AfterAddRowEventArgs e) {
    // Merge cells in rows that correspond to the grid's group rows.
    if (e.DataSourceRowIndex < 0) {
        e.ExportContext.MergeCells(new XlCellRange(new XlCellPosition(0, e.DocumentRow-1), new XlCellPosition(5, e.DocumentRow-1)));
See Also