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.v20.1.Core.dll

Declaration

public event AfterAddRowEventHandler AfterAddRow
Public Event AfterAddRow As AfterAddRowEventHandler

Remarks

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

NOTE

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

Examples

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.

GridExportOutputResult

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)));
    }
}

Implements

DevExpress.Export.IDataAwareExportOptions.AfterAddRow
See Also