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

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