Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

CellValueToColumnTypeConverter.CheckNarrowingConversion Property

Gets or sets whether the result of the conversion is within the range of the destination data type.

Namespace: DevExpress.Spreadsheet.Export

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

Declaration

public bool CheckNarrowingConversion { get; set; }

Property Value

Type Description
Boolean

true, to check for narrowing conversion; otherwise, false. Default is false.

Remarks

The CheckNarrowingConversion allows you to check for a narrowing conversion before data is written to the DataTable. If a cell value is converted to a DataTable column data type that is not able to hold the value, a narrowing conversion occurs. For example, a fractional value is converted to an integral type.

If the CheckNarrowingConversion property is set to false (default), the narrowing conversion results in an OverflowException. To avoid this, set the CheckNarrowingConversion property to true and subscribe to the DataTableExporter.CellValueConversionError event. If the narrowing conversion occurs, the CellValueConversionErrorEventArgs.ConversionResult is set to the ConversionResult.Overflow value and you can take appropriate actions to correct data for the DataTable.

See Also