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


Glossary Item Box

Gets or sets the value in a cell.

Syntax

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

Property Value

Object containing the unformatted contents of this cell

Remarks

This property gets or sets the raw unformatted data in a cell. The data handled with this property is placed directly in the data model and is not parsed or formatted.

This property is available at run time only.

The Value property may be null if the cell is empty (that is, contains no data). Before a check box cell (CheckBoxCellType) is set, it contains no data, so appears the same as unchecked.

Besides using this property, you can get or set the value 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 Value property with the values returned from the Text property. For example, for date-time cells, the Text property returns the formatted date and time value; the Value property returns a DateTime object.

Example

This example creates a Cell object, defines it as a DateTime cell and puts a Value of Now in the cell.
C#Copy Code
FarPoint.Web.Spread.Cellmycell;
mycell=FpSpread1.Cells[0,0];
mycell.CellType=newFarPoint.Web.Spread.DateTimeCellType();
mycell.Value=System.DateTime.Now;
Visual BasicCopy Code
DimmycellAsFarPoint.Web.Spread.Cell
mycell=FpSpread1.Cells(0,0)
mycell.CellType=NewFarPoint.Web.Spread.DateTimeCellType()
mycell.Value=Date.Now

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.