Spread ASP.NET 6.0 Product Documentation
Text Property
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > Cell Class : Text Property


Glossary Item Box

Gets or sets the formatted text in a cell.

Syntax

Visual Basic (Declaration) 
Public Property Text As String
Visual Basic (Usage)Copy Code
Dim instance As Cell
Dim value As String
 
instance.Text = value
 
value = instance.Text
C# 
public string Text {get; set;}

Property Value

String containing the formatted contents of this cell

Remarks

This property gets or sets the formatted data in a cell using the IFormatter object for that cell to do the parsing. If setting the text, the data handled with this property is placed in the data model after it is parsed; if getting the text, the data is retrieved from the data model and parsed using the formatter.

Besides using this property, you can get or set the text in a cell using several methods available at the sheet level (with the SheetView object). For more information, see Handling Data Using Sheet Methods.

Remember that the data may be displayed differently in a cell depending on the cell type. For more information, see Understanding Cell Type Effects on Displaying Data. Compare the values returned from the Text property with the values returned from the Value property. For example, for date-time cells, the Text property returns the formatted date and time value; the Value property returns a DateTime object for the date and time.

Example

This example creates a Cell object and supplies a note for the cell. When the user passes the mouse over the cell, a note appears at the mouse pointer.
C#Copy Code
FarPoint.Web.Spread.Cellmycell;
FarPoint.Web.Spread.Insetmargin=newFarPoint.Web.Spread.Inset(20,40,50,20);
mycell=FpSpread1.Cells[0,0];
mycell.Text="NoteTest";
mycell.Locked=true;
mycell.Margin=margin;
mycell.Note="ThisistheNote";
FpSpread1.ActiveSheetView.Rows[0].Height=80;
Visual BasicCopy Code
DimmycellAsFarPoint.Web.Spread.Cell
DimmarginAsNewFarPoint.Web.Spread.Inset(20,40,50,20)
mycell=FpSpread1.Cells(0,0)
mycell.Text="NoteTest"
mycell.Locked=True
mycell.Margin=margin
mycell.Note="ThisistheNote"
FpSpread1.ActiveSheetView.Rows(0).Height=80

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.