Back to Devexpress

CellValue.TextValue Property

officefileapi-devexpress-dot-spreadsheet-dot-cellvalue-0ef0af90.md

latest7.0 KB
Original Source

CellValue.TextValue Property

Returns a string contained in a cell.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public string TextValue { get; }
vb
Public ReadOnly Property TextValue As String

Property Value

TypeDescription
String

A String value specifying the text value of a cell.

|

Remarks

Use the TextValue property to obtain the text value contained in a cell. To check whether the cell value is of the text type, use the CellValue.IsText or CellValue.Type property. If a cell value type is other than text, the TextValue property returns null (Nothing in VB). To get a string that specifies a cell value of any type as it is displayed in the cell, use the Cell.DisplayText property.

For more information on cell values, refer to the Cell Data Types document.

The following code snippets (auto-collected from DevExpress Examples) contain references to the TextValue property.

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.

how-to-bind-a-worksheet-to-a-generic-list-or-a-bindinglist-data-source/CS/DataBindingToListExample/MyConverter.cs#L15

csharp
Weather w;
if (Enum.TryParse(value.TextValue, out w)) return w;
return Weather.Undefined;

winforms-spreadsheet-use-custom-cell-editors/CS/DevAVInvoicing/Form1.cs#L141

csharp
// to display stores owned by the customer with the specified ID.
string customerId = invoice["B11"].Value.TextValue;
Table storesTable = customerStores.Tables[0];

wpf-spreadsheet-bind-a-worksheet-to-generic-list-or-bindinglist-data-source/CS/DataBindingToListExample/MyConverter.cs#L15

csharp
Weather w;
if (Enum.TryParse(value.TextValue, out w)) return w;
return Weather.Undefined;

spreadsheet-document-api-data-binding/CS/SpreadsheetApiDataBinding/MyConverter.cs#L21

csharp
Weather w;
if (Enum.TryParse(value.TextValue, out w)) return w;
return Weather.Undefined;

wpf-spreadsheet-bind-spreadsheet-to-ms-sql-server-database/CS/WpfSpreadsheet_BindToDataSource/MainWindow.xaml.cs#L74

csharp
dataSet.Suppliers.AddSuppliersRow(
    sheet["C4"].Value.TextValue, sheet["C6"].Value.TextValue, sheet["C8"].Value.TextValue,
    sheet["E4"].Value.TextValue, sheet["E6"].Value.TextValue, sheet["E8"].Value.TextValue,

how-to-bind-a-worksheet-to-a-generic-list-or-a-bindinglist-data-source/VB/DataBindingToListExample/MyConverter.vb#L18

vb
Dim w As Weather = Nothing
If System.Enum.TryParse(value.TextValue, w) Then
    Return w

winforms-spreadsheet-use-custom-cell-editors/VB/DevAVInvoicing/Form1.vb#L129

vb
' to display stores owned by the customer with the specified ID.
Dim customerId As String = invoice("B11").Value.TextValue
Dim storesTable As Table = customerStores.Tables(0)

wpf-spreadsheet-bind-a-worksheet-to-generic-list-or-bindinglist-data-source/VB/DataBindingToListExample/MyConverter.vb#L18

vb
Dim w As Weather = Nothing
If System.Enum.TryParse(value.TextValue, w) Then
    Return w

spreadsheet-document-api-data-binding/VB/SpreadsheetApiDataBinding/MyConverter.vb#L16

vb
Dim w As Weather = Nothing
If System.Enum.TryParse(value.TextValue, w) Then
    Return w

spreadsheet-document-api-use-worksheet-table-as-data-source/VB/SpreadsheetDocumentServerAsDataSourceExample/MyPictureProvider.vb#L20

vb
Dim pic As DXImage = Nothing
If pictures.TryGetValue(value.TextValue, pic) Then
    Return pic

See Also

IsText

BooleanValue

DateTimeValue

NumericValue

ErrorValue

Cell Data Types

CellValue Class

CellValue Members

DevExpress.Spreadsheet Namespace