Syncfusion.XlsIO.Base
Example 


DisplayText Property (IRange)

Gets cell value with its number format. Read-only.
Syntax
'Declaration
 
ReadOnly Property DisplayText As String
'Usage
 
Dim instance As IRange
Dim value As String
 
value = instance.DisplayText
string DisplayText {get;}
Remarks

While accessing DisplayText for Range of cells, it gets DisplayText of the first cell

If a range contains a formula, IWorksheet.EnableSheetCalculations must be invoked to get the calculated value of the formula

Example
The following code illustrates how to access DisplayText property of the Range.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
            
IWorksheet sheet = workbook.Worksheets[0];
IRange range= sheet.Range[3, 1];
range.Value = "1/1/2015";
range.NumberFormat = "dd-MMM-yyyy";
string displayText = range.DisplayText;
            
workbook.SaveAs("DisplayText.xlsx");
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 16.3460.0.21

See Also