MindFusion.Wpf Pack Programmer's Guide
Cell.Data Property
See Also
 





Gets or sets the cell data.

Namespace: MindFusion.Spreadsheet.Wpf
Assembly: MindFusion.Spreadsheet.Wpf

 Syntax

C#  Copy Code

public Object Data { get; set; }

Visual Basic  Copy Code

Public Property Data As Object

 Property Value

An object representing the cell data.

 Remarks

If this property is set to null (Nothing in Visual Basic), this is equivalent to clearing the cell via Clear. If the specified value is a string, starting with an equal sign '=', it is interpreted as a formula. To specify a string, starting with an equal sign as cell data, prefix the string with a single apostrophe '''.

If this property is set to a string, Spreadsheet for WPF attempts to parse the string into one of the following types, according to the culture of the parent workbook: number (raw number, percentage, or currency), time, date, or logical. If the value cannot be converted, the value is accept as a string. The effective value of the cell can be subsequently retrieved through the Value property.

 Example

The following example sets the data of an existing cell.

C#  Copy Code

cell.Data = "1/6/2013";
cell.Data = "45%";
cell.Data = 50;
cell.Data = "=MAX(A1:C4)";
cell.Data = "'=not a formula=";

Visual Basic  Copy Code

cell.Data = "1/6/2013"
cell.Data = "45%"
cell.Data = 50
cell.Data = "=MAX(A1:C4)"
cell.Data = "'=not a formula="

 See Also

Cell Members
Cell Class
MindFusion.Spreadsheet.Wpf Namespace