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


Glossary Item Box

Gets or sets the format string used to format the value.

Syntax

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

Property Value

String containing the format string

Remarks

The value of a general cell can be a string, a number, or a DateTime object.

The formats supported are the numeric formats and date-time formats in .NET framework.

Example

C#Copy Code
System.Globalization.DateTimeFormatInfo dtf = new System.Globalization.DateTimeFormatInfo();
dtf.LongDatePattern = "D";
dtf.ShortDatePattern = "M/d/yyyy";
FarPoint.Web.Spread.GeneralCellType g = new FarPoint.Web.Spread.GeneralCellType();
g.DateTimeFormat = dtf;
g.FormatString = dtf.ShortDatePattern
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = g;
FpSpread1.ActiveSheetView.Cells[0, 0].Value = DateTime.Now;
Visual BasicCopy Code
Dim dtf As New System.Globalization.DateTimeFormatInfo
Dim b As Boolean
dtf.LongDatePattern = "D"
dtf.ShortDatePattern = "M/d/yyyy"
Dim g As New FarPoint.Web.Spread.GeneralCellType
g.DateTimeFormat = dtf
g.FormatString = dtf.ShortDatePattern
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = g
FpSpread1.ActiveSheetView.Cells(0, 0).Value = DateTime.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.