Back to Devexpress

DataTableExportOptions.ConvertEmptyCells Property

officefileapi-devexpress-dot-spreadsheet-dot-export-dot-datatableexportoptions-0e5da6c8.md

latest3.8 KB
Original Source

DataTableExportOptions.ConvertEmptyCells Property

Gets or sets whether a cell with an empty value is processed by a converter.

Namespace : DevExpress.Spreadsheet.Export

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public bool ConvertEmptyCells { get; set; }
vb
Public Property ConvertEmptyCells As Boolean

Property Value

TypeDescription
Boolean

true , to process cells with empty values; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ConvertEmptyCells
DataTableExporter

.Options .ConvertEmptyCells

|

Remarks

Cells with empty values (the CellValue.IsEmpty property is true ) are skipped for better performance. Corresponding values in the target DataTable are left intact.

To run a converter for empty cells, set the ConvertEmptyCells option to true.

If the entire row in the source range does not contain values, and the DataTableExportOptions.ConvertEmptyCells option is set to true , the ConvertEmptyCells setting is ignored.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ConvertEmptyCells property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-export-cell-range-to-a-datatable/CS/ExportToDataTableExample/Form1.cs#L109

csharp
// Specify exporter options.
exporter.Options.ConvertEmptyCells = true;
exporter.Options.DefaultCellValueToColumnTypeConverter.EmptyCellValue = 0;

how-to-export-cell-range-to-a-datatable/VB/ExportToDataTableExample/Form1.vb#L103

vb
' Specify exporter options.
exporter.Options.ConvertEmptyCells = True
exporter.Options.DefaultCellValueToColumnTypeConverter.EmptyCellValue = 0

spreadsheet-document-api-export-worksheet-range-to-datatable/VB/ExportToDataTableWorkbookExample/Form1.vb#L38

vb
myconverter.EmptyCellValue = "N/A"
exporter.Options.ConvertEmptyCells = True

See Also

DataTableExportOptions Class

DataTableExportOptions Members

DevExpress.Spreadsheet.Export Namespace