Skip to main content
Row

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

IDataValueConverter.TryConvert(Object, Int32, out CellValue) Method

Converts data being imported to the cell value.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

bool TryConvert(
    object value,
    int index,
    out CellValue result
)

#Parameters

Name Type Description
value Object

An object that is the data being imported to a cell.

index Int32

An integer that is the index of the column in the data source.

result CellValue

A CellValue object that is the value which will be inserted in a cell.

#Returns

Type Description
Boolean

true, if a conversion is successful; otherwise, false.

#Remarks

When importing data to a worksheet, you can use the WorksheetExtensions.Import method overload that has the IDataValueConverter interface as a parameter. It enables you to change data before insertion in a worksheet.

To accomplish data conversion, create a class that implements the IDataValueConverter interface and pass it as the parameter to the WorksheetExtensions.Import method.

See Also