Back to Devexpress

CellValue.IsText Property

officefileapi-devexpress-dot-spreadsheet-dot-cellvalue-97683d11.md

latest6.7 KB
Original Source

CellValue.IsText Property

Gets whether the cell contains text.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public bool IsText { get; }
vb
Public ReadOnly Property IsText As Boolean

Property Value

TypeDescription
Boolean

true , if the cell value is of the text type; otherwise, false

|

Remarks

To get the text string contained in a cell, use the CellValue.TextValue 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 IsText 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.

winforms-spreadsheet-how-to-edit-rich-text/CS/SpreadsheetRichText/Form1.cs#L46

csharp
Cell activeCell = spreadsheetControl.ActiveCell;
if (activeCell.Value.IsEmpty || (!activeCell.HasFormula && activeCell.Value.IsText))
{

spreadsheet-document-api-use-worksheet-table-as-data-source/CS/SpreadsheetDocumentServerAsDataSourceExample/MyColumnDetector.cs#L21

csharp
CellValue value = range[0, offset].Value;
if (value.IsText) return typeof(string);
if (value.IsBoolean) return typeof(bool);

winforms-spreadsheet-use-cell-range-as-data-source/CS/RangeDataSource/MyColumnDetector.cs#L21

csharp
CellValue value = range[0, offset].Value;
if (value.IsText) return typeof(string);
if (value.IsBoolean) return typeof(bool);

winforms-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_API_Part02/Utils.cs#L14

csharp
{
    if (!a.IsText || !b.IsText) return 0;
    if (a.TextValue.Length == b.TextValue.Length) return 0;

wpf-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_WPF_API_Part02/Utils.cs#L14

csharp
{
    if (!a.IsText || !b.IsText) return 0;
    if (a.TextValue.Length == b.TextValue.Length) return 0;

winforms-spreadsheet-how-to-edit-rich-text/VB/SpreadsheetRichText/Form1.vb#L40

vb
Dim activeCell As Cell = spreadsheetControl.ActiveCell
If activeCell.Value.IsEmpty OrElse (Not activeCell.HasFormula AndAlso activeCell.Value.IsText) Then
    Dim setRichTextItem As New SpreadsheetMenuItem("Set Rich Text", New EventHandler(AddressOf SetRichTextItemClick))

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

vb
Dim value As CellValue = range(0, offset).Value
If value.IsText Then
    Return GetType(String)

winforms-spreadsheet-use-cell-range-as-data-source/VB/RangeDataSource/MyColumnDetector.vb#L19

vb
Dim value As CellValue = range(0, offset).Value
If value.IsText Then Return GetType(String)
If value.IsBoolean Then Return GetType(Boolean)

winforms-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_API_Part02/Utils.vb#L13

vb
Public Function Compare(ByVal a As DevExpress.Spreadsheet.CellValue, ByVal b As DevExpress.Spreadsheet.CellValue) As Integer Implements IComparer(Of DevExpress.Spreadsheet.CellValue).Compare
    If (Not a.IsText) OrElse (Not b.IsText) Then
        Return 0

wpf-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_WPF_API_Part02/Utils.vb#L12

vb
Public Function Compare(ByVal a As DevExpress.Spreadsheet.CellValue, ByVal b As DevExpress.Spreadsheet.CellValue) As Integer Implements IComparer(Of DevExpress.Spreadsheet.CellValue).Compare
    If (Not a.IsText) OrElse (Not b.IsText) Then
        Return 0

See Also

IsEmpty

IsBoolean

IsNumeric

IsDateTime

IsError

Type

CellValue Class

CellValue Members

DevExpress.Spreadsheet Namespace