Skip to main content
All docs
V25.1
  • TreeListRowExportingEventArgs.Cancel Property

    Specifies whether the row should be excluded from export.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    public bool Cancel { get; set; }

    Property Value

    Type Description
    Boolean

    true to cancel the row export; false to export the row.

    Remarks

    The RowExporting action is called before a row is exported and allows you to cancel the action. Write the action handler to filter the exported data. Set the Cancel property to true to prevent the export of the processed row.

    Note

    If you exclude a node that has children from the exported document, you should also cancel the export of all its child nodes. Otherwise, the data hierarchy in the resulting document breaks.

    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