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.v24.2.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
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.