Breaking Change T890004
Visible to All Users

Data-aware export to CSV format - Controls now export cell display text, but not underlying values

What Changed
In data-aware export mode, the ExportToCsv methods of affected controls now export cell display text. Previous versions exported underlying cell values.

Reasons for Change
In previous versions, the controls' ExportToCsv methods exported cell values instead of text if the CsvExportOptionsEx.TextExportMode property was set to Text (default) in data-aware export mode.

Now, if the CsvExportOptionsEx.TextExportMode property is set to Text, the ExportToCsv methods export cell display text.

The current change does not affect WYSIWYG export mode.

Impact on Existing Apps

The default output of the ExportToCsv method is different for v20.1.4+ and previous versions.

How to Revert to Previous Behavior
To export cell values to CSV format, call the ExportToCsv method with a CsvExportOptionsEx object passed as the options parameter. Set the CsvExportOptionsEx.TextExportMode property to Value.

WinForms Data Grid:

C#
CsvExportOptionsEx optionsCsv = new CsvExportOptionsEx(); optionsCsv.TextExportMode = TextExportMode.Value; gridView1.ExportToCsv(pathCsv, optionsCsv);
Visual Basic
Dim optionsCsv As New CsvExportOptionsEx optionsCsv.TextExportMode = TextExportMode.Value GridView1.ExportToCsv(pathCsv, optionsCsv)

ASP.NET Grid View:

ASPx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" OnBeforeExport="ASPxGridView1_BeforeExport" .....
C#
protected void ASPxGridView1_BeforeExport(object sender, DevExpress.Web.ASPxGridBeforeExportEventArgs e) { if(e.ExportTarget == ExportTarget.Csv) { var opts = e.ExportOptions as CsvExportOptionsEx; opts.TextExportMode = TextExportMode.Value; } }
Visual Basic
Protected Sub ASPxGridView1_BeforeExport(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridBeforeExportEventArgs) If e.ExportTarget = ExportTarget.Csv Then Dim opts = TryCast(e.ExportOptions, CsvExportOptionsEx) opts.TextExportMode = TextExportMode.Value End If End Sub

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.