Infragistics(R) NetAdvantage(R) WPF
Value Property
See Also  E-mail your feedback on this topic.
Infragistics.Documents.Excel Namespace > WorksheetCell Class : Value Property

Gets or sets the value of the cell.

Syntax

Visual Basic (Declaration) 
Public Property Value As Object
C# 
public object Value {get; set;}

Property Value

The value of the cell.

Exceptions

ExceptionDescription
System.NotSupportedException The assigned value's type is not supported and can't be exported to Excel.
System.InvalidOperationException The value assigned is a . Instead, should be called on the Formula, passing in the cell.
System.InvalidOperationException The value assigned is a . Instead, the should be set to a region containing the cell.
System.InvalidOperationException The value assigned is a FormattedString which is the value another cell or merged cell region.
System.InvalidOperationException The value is assigned and this cell is part of an or WorksheetDataTable.

Remarks

If this cell belongs to a merged cell region and it is the top-left cell of the region, getting and setting the value will get and set the value of the associated merged cell region. Getting the value of other cells in a merged cell region will always return null. Setting the value of other cells in a merged cell region will have no effect.

If a formula has been applied to the cell or a data table is associated with the cell, getting the Value will return the calculated value of the cell.

The types supported for the value are:

  • System.Byte
  • System.SByte
  • System.Int16
  • System.Int64
  • System.UInt16
  • System.UInt64
  • System.UInt32
  • System.Int32
  • System.Single
  • System.Double
  • System.Boolean
  • System.Char
  • System.Enum
  • System.Decimal
  • System.DateTime
  • System.String
  • System.Text.StringBuilder
  • System.DBNull
  • ErrorValue
  • FormattedString

Note: it is slightly faster to use the WorksheetRow.GetCellValue or WorksheetRow.SetCellValue methods, which do not create WorksheetCell instances internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellComment or WorksheetRow.SetCellComment methods.

See Also