TreeListCsvExportOptions.QuoteStringsWithSeparators Property
Specifies whether a value that contains separators is enclosed in quotation marks.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(true)]
public bool QuoteStringsWithSeparators { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | true |
|
Remarks
A CSV file stores data in rows where values are delimited with the Separator string. If a value contains a character or character string that matches the separator, you may want to wrap the value into quotation marks to avoid splitting it into multiple parts. Set the QuoteStringsWithSeparators
property to true
to enclose such values in quotation marks.
The code example below ensures that no value is enclosed in quotation marks:
<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() {
QuoteStringsWithSeparators = false
});
}
}
See Also