Skip to main content
All docs
V24.2

TreeListExportOptions.ExportSelectedRowsOnly Property

Specifies whether the TreeList exports selected rows only.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(false)]
public override bool ExportSelectedRowsOnly { get; set; }

Property Value

Type Default Description
Boolean false

true to export the selected rows only; false to export all TreeList rows.

Remarks

Set the ExportSelectedRowsOnly property to true to export selected rows only. The following example activates this option:

<DxButton Text="Export to XLSX" Click="ExportXlsx_Click" />

<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId" @ref="MyTreeList">
    <Columns>
        <DxTreeListSelectionColumn />
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>

@code {
    ITreeList MyTreeList { get; set; }

    async Task ExportXlsx_Click() {
        await MyTreeList.ExportToXlsxAsync("ExportResult", new TreeListXlExportOptions() {
            ExportSelectedRowsOnly = true
        });
    }
}

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

See Also