Back to Devexpress

TreeListCsvExportOptions Class

blazor-devexpress-dot-blazor-b4d76c2c.md

latest2.5 KB
Original Source

TreeListCsvExportOptions Class

Contains options that define how the TreeList exports its content in CSV format.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public class TreeListCsvExportOptions :
    TreeListExportOptions,
    IGridCsvExportOptions

Remarks

When you export the TreeList’s data in CSV format (the ExportToCsvAsync method), the TreeListCsvExportOptions object allows you to customize the resulting document’s settings. Note that only data cell values are exported: summaries and cell style settings are ignored.

Important

Security Considerations

Exported data can contain executable content. To prevent possible security vulnerabilities, set the EncodeExecutableContent property to true to enclose potentially dangerous content in quotation marks prior to exporting it to the CSV format. To learn more, see the property description.

razor
<DxButton Text="Export to CSV" Click="ExportCsv_Click" />
<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId" @ref="MyTreeList">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>

@code {
    ITreeList MyTreeList { get; set; }

    async Task ExportCsv_Click() {
        await MyTreeList.ExportToCsvAsync("ExportResult", new TreeListCsvExportOptions() {
            ExportSelectedRowsOnly = true
        });
    }
}

Run Demo: TreeList - Export

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

Inheritance

Object DevExpress.Blazor.Grid.Internal.GridExportOptionsBase TreeListExportOptions TreeListCsvExportOptions

See Also

TreeListCsvExportOptions Members

DevExpress.Blazor Namespace