Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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