TreeListExportOptions.ExportDisplayText Property
Indicates whether the TreeList exports cell values in the same format they are presented in the compoment.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(false)]
public override bool ExportDisplayText { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | false |
|
Remarks
When you export data in CSV, XLS or XLSX format, the TreeList exports cell values. Set the ExportDisplayText
property to true
to export display text instead of values. This scenario can be useful when you specify custom display text for cells (see the DisplayFormat property and CustomizeCellDisplayText event descriptions).
In the following example, the TreeList exports data with the month/day pattern applied to the Start Date column:
<DxButton Text="Export to XLSX" Click="ExportXlsx_Click" />
<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId" @ref="MyTreeList">
<Columns>
<DxTreeListDataColumn FieldName="Name" Caption="Task" />
<DxTreeListDataColumn FieldName="EmployeeName" />
<DxTreeListDataColumn FieldName="StartDate" DisplayFormat="m" />
<DxTreeListDataColumn FieldName="DueDate" />
</Columns>
</DxTreeList>
@code {
ITreeList MyTreeList { get; set; }
async Task ExportXlsx_Click() {
await MyTreeList.ExportToXlsxAsync("ExportResult", new TreeListXlExportOptions() {
ExportDisplayText = true
});
}
}
ExportResult.xlsx
For more information about data export in the TreeList component, refer to the following topic: Export Data in Blazor TreeList.