Spread Windows Forms 11.0 Product Documentation
FormatString Property (GeneralCellType)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > GeneralCellType Class : FormatString Property
Gets or sets the format string used to format the value.
Syntax
'Declaration
 
Public Overridable Property FormatString As String
'Usage
 
Dim instance As GeneralCellType
Dim value As String
 
instance.FormatString = value
 
value = instance.FormatString
public virtual string FormatString {get; set;}

Property Value

String containing the format
Remarks

The value of a general cell can be a string, a number, or a DateTime object. The general cell does not support a format string using "r" or "R".

The formats supported are the NumberFormatInfo object and the DateTimeFormatInfo object that can be found in the Microsoft .NET framework SDK documentation. Discussion of these formats are in the numeric formats and date-time formats topics in the Microsoft .NET Developer's Guide.

Example
This example specifies the format string used to format the date value.
FarPoint.Win.Spread.CellType.GeneralCellType genlcell = new FarPoint.Win.Spread.CellType.GeneralCellType();
genlcell.FormatString = "dd/MM/yyyy";
genlcell.IsDateFormat = true;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = genlcell;
fpSpread1.ActiveSheet.Cells[0, 0].Value = DateTime.Now;
Dim genlcell As New FarPoint.Win.Spread.CellType.GeneralCellType()
genlcell.FormatString = "dd/MM/yyyy"
genlcell.IsDateFormat = True
FpSpread1.ActiveSheet.Cells(0, 0).CellType = genlcell
FpSpread1.ActiveSheet.Cells(0, 0).Value = DateTime.Now
See Also

Reference

GeneralCellType Class
GeneralCellType Members
SetFormatString Method
Numeric Formats (.NET)
Date-Time Formats (.NET)
NumberFormatInfo Object
DateTimeFormatInfo Object