Skip to main content
All docs
V24.2

TreeListExportOptions.RowExporting Property

Fires before a row is exported and allows you to cancel the action.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public Action<TreeListRowExportingEventArgs> RowExporting { get; set; }

Property Value

Type Description
Action<TreeListRowExportingEventArgs>

A delegate method that specifies whether the row export should be canceled.’

Remarks

Create a RowExporting delegate action handler to filter the exported data.

The TreeList calls the RowExporting action for data rows. The following event argument properties allow you to get information about the processed row:

DataItem
Returns a data source item that is bound to a currently processed row.
GetRowValue(String)
Returns the value of the specified data field in the current row.

Set the Cancel property to true to exclude the row from the exported document.

For more information about data export in the TreeList component, refer to the following topic: Export Data in Blazor TreeList.

Example

The following example handles the RowExporting action handler:

async Task ExportXlsx_Click() {
    await MyTreeList.ExportToXlsxAsync("ExportResult", new TreeListXlExportOptions() {
        RowExporting = RowExporting
    });
}
void RowExporting(TreeListRowExportingEventArgs e) {
    // Exports rows whose due date is earlier than January 1, 2018
    if ((DateTime)e.GetRowValue("DueDate") > new DateTime(2018, 1, 1)) {
        e.Cancel = true;
    }
}
See Also