officefileapi-devexpress-dot-spreadsheet-dot-cellvalue-dot-trycreatefromobject-x28-system-dot-object-x29.md
Tries to convert the specified object to a cell value using the default converter.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
public static CellValue TryCreateFromObject(
object value
)
Public Shared Function TryCreateFromObject(
value As Object
) As CellValue
| Name | Type | Description |
|---|---|---|
| value | Object |
An object to be converted to a CellValue.
|
| Type | Description |
|---|---|
| CellValue |
A CellValue object. If the conversion cannot be performed, the TryCreateFromObject method returns null (Nothing in VB).
|
To convert a cell value to an object, use the CellValue.ToObject method. For more information on cell values and their types, refer to Cell Data Types.
The following code snippets (auto-collected from DevExpress Examples) contain references to the TryCreateFromObject(Object) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
return CellValue.TryCreateFromObject(value);
}
return CellValue.TryCreateFromObject(value);
}
spreadsheet-document-api-data-binding/CS/SpreadsheetApiDataBinding/MyConverter.cs#L56
return CellValue.TryCreateFromObject(value);
}
}
result = DevExpress.Spreadsheet.CellValue.TryCreateFromObject(value);
return true;
Return CellValue.TryCreateFromObject(value)
End Function
Return CellValue.TryCreateFromObject(value)
End Function
spreadsheet-document-api-data-binding/VB/SpreadsheetApiDataBinding/MyConverter.vb#L46
Return CellValue.TryCreateFromObject(value)
End Function
result = DevExpress.Spreadsheet.CellValue.TryCreateFromObject(value)
Return True
result = DevExpress.Spreadsheet.CellValue.TryCreateFromObject(value)
Return True
See Also
How to: Change a Cell or Cell Range Value
How to: Convert Objects to Cell Values and Cell Values to Objects