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

CellValue.ToString(IFormatProvider) Method

Returns a string representation of the cell value.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

public string ToString(
    IFormatProvider formatProvider
)

#Parameters

Name Type Description
formatProvider IFormatProvider

An object implementing the IFormatProvider interface.

#Returns

Type Description
String

A String that represents the current CellValue object.

#Remarks

Use this method overload to retrieve the cell value as a string with the specified culture settings.

The code sample below retrieves a cell value as a string in the invariant culture:

var workbook = new Workbook();
workbook.LoadDocument(@"C:\Docs\Comments.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
string cellValue =
    worksheet["B5"].Value.ToString(CultureInfo.InvariantCulture);
See Also