Skip to main content
All docs
V25.1
  • TreeListCsvExportOptions.Separator Property

    Specifies a character sequence that separates values in the exported CSV file.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    public string Separator { get; set; }

    Property Value

    Type Description
    String

    Any character or character sequence.

    Remarks

    CSV is a text format that stores data in rows where values are delimited by a separator. When you export TreeList content, the default separator is a comma (,). If the comma is used as a decimal separator in the current culture, the default separator is a semicolon (;).

    Use the Separator property to change the default separator.

    The following code snippet uses a space as a value separator:

    <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() {
                Separator = " "
            });
        }
    }
    

    You can use the QuoteStringsWithSeparators property to enclose values in quotation marks if they contain the same character or character sequence as a separator.

    See Also