Skip to main content

CellValueToColumnTypeConverter.TreatStringAsZero Property

Gets or sets whether a cell containing text should be converted to a 0 (zero) numeric value.

Namespace: DevExpress.Spreadsheet.Export

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

public bool TreatStringAsZero { get; set; }

Property Value

Type Description
Boolean

true, to return 0 (zero) if the converted cell contains text; otherwise, false.

Remarks

The use cases for the TreatStringAsZero property are listed in the following table.

CellValueToColumnTypeConverter.ConvertStringValues TreatStringAsZero Effect
true any An attempt is made to convert cell text to the specified type. The TreatStringAsZero property is ignored.
false true If the destination data type is not the String, the conversion result is zero (0) numeric value.
false false If the destination data type is not the String, the ConversionResult.Error is returned. Handle the DataTableExporter.CellValueConversionError event to prevent an exception from being thrown.
See Also